TooTallNate / node-speaker

Output PCM audio data to the speakers
648 stars 145 forks source link

Select audio device #91

Closed meldron closed 6 years ago

meldron commented 7 years ago

Patch to allow the selection of the audio device via opts.device, which is then passed to mpeg123 (as ao->device).

Flowr-es commented 7 years ago

I would like to see this in, the code looks fine for me but I'm no contributor. Also looking to the automated builds, acutally only on node 2 and 3 it is failing, I think this is not related to your changes.

Update: I have tested it on my Raspberry (Linux) and it seems not to work, I have given the device name that was given from aplay -L but there is no output on this device (on my default is currently no speaker, so I cannot say if it is no audio output or still on default device)

meldron commented 7 years ago

Hey @MexXxo,

can you tell me whats the problem with the output?

Did you check the number of channels our device supports?

LinusU commented 7 years ago

Hey @meldron,

Sorry for the huge delay on this, would you mind including some documentation for this in the readme?

Thanks :)

Flowr-es commented 7 years ago

@meldron once I will get my hands on this again, I will try to provide more infromation. My output device should handle both, single and stereo channel.

Flowr-es commented 7 years ago

Hey @meldron, sorry I have simply set my usb audio device to default via alsa, so I discontinued testing. I'm sure that I did something wrong and your implementation should be fine

T-vK commented 7 years ago

@meldron @LinusU I'm very interested in seeing this being merged. I assume the device parameter is equal to what you would pass to ALSA? i.e. hw:0,0 or plughw:CARD=0,DEV=0? In that case, I wouldn't mind adding that to the readme.

T-vK commented 7 years ago

I just want to confirm my assumption about the device parameter. I have tested it and it works without a problem. (That is on Linux with ALSA.)

For the readme, this is what I could provide:

meldron commented 6 years ago

Hey guys and @LinusU , so I guess i totally forgot to add the docs. Still interessted? I would apply the patch to the lastest version in master or are you going to switch to libao soon?

T-vK commented 6 years ago

As far as I'm concerned, yes, i'm still interested.

LinusU commented 6 years ago

Just merged #105 and released as version 0.4.1

device support is now live 🚀 thanks a ton to everyone who helped out with this!