Possible to specify audio device and default to hw:0 to stop using PusleAudio

This commit is contained in:
Iwan Timmer
2014-02-12 17:53:39 +01:00
parent 56eea63aad
commit 54c72cd0f0
7 changed files with 39 additions and 13 deletions

View File

@@ -7,10 +7,16 @@ import com.limelight.nvstream.av.audio.AudioRenderer;
* @author Iwan Timmer
*/
public class AlsaAudioRenderer implements AudioRenderer {
private String device;
public AlsaAudioRenderer(String device) {
this.device = device;
}
@Override
public void streamInitialized(int channelCount, int sampleRate) {
int ret = AlsaAudio.init(channelCount, sampleRate);
int ret = AlsaAudio.init(channelCount, sampleRate, device.getBytes());
if (ret != 0)
throw new IllegalStateException("AVC decoder initialization failure: "+ret);
}