mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-18 06:20:05 +00:00
Possible to specify audio device and default to hw:0 to stop using PusleAudio
This commit is contained in:
@@ -39,7 +39,7 @@ public class PlatformBinding {
|
||||
* Gets an instance of an audio decoder/renderer.
|
||||
* @return an audio decoder and renderer
|
||||
*/
|
||||
public static AudioRenderer getAudioRenderer() {
|
||||
return new AlsaAudioRenderer();
|
||||
public static AudioRenderer getAudioRenderer(String device) {
|
||||
return new AlsaAudioRenderer(device);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ public class AlsaAudio {
|
||||
System.loadLibrary("nv_alsa");
|
||||
}
|
||||
|
||||
public static native int init(int channelCount, int sampleRate);
|
||||
public static native int init(int channelCount, int sampleRate, byte[] device);
|
||||
|
||||
public static native void close();
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user