5

I'm trying to reproduce a mono wav file over just one of the stereo channels (speakers) that my smartphone has. I used to control this with

AudioTrack.setStereoVolume (float leftGain, float rightGain)

by setting one of these gains to zero. Reviewing an old code I got a deprecated method warning and after checking Android SDK documentation I've found it is now done by :

public int setVolume (float gain)

Added in API level 21. This API is preferred over setStereoVolume(float, float), as it more gracefully scales down to mono, and up to multi-channel content beyond stereo.

My questions are:

  1. How would I control the channels volume individually so that only one channel reproduces at a given time now that I'm supposed to control both channels at the same time with the new version of the method?
  2. Is there a way to check through Android API if a certain device has stereo or mono speakers?
  3. Is there another way to reproduce mono audio through a single speaker only?
VMMF
  • 906
  • 1
  • 17
  • 28
  • Can you answer this question ?? http://stackoverflow.com/questions/39448570/how-i-can-transfer-data-over-voice-using-ultrasound-in-android – Sukhpal Singh Sep 16 '16 at 07:29

0 Answers0