-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FR: snapclient as a source (output raw samples to stdout/pipe) #681
Comments
It should work to write the buffer_.data() to stdout (this is undocumented, because it's not finished, PRs are welcome ;)). Maybe the distortion comes from logging (going to stdout by default). You can use a different log sink with |
Thanks for the quick reply. I did exactly what you mentioned, aka. output data() to stdout & remove stdout clutter (I didn't bother with --logsink, I just hacked the code) and piping to @badaix, I'd be happy to contribute a PR, but may I suggest you give it a try too and share the changes & format flags you used for playback, because at this point I'm not sure what to try next for this to work. Thanks for your help. |
I've added this line
|
Amazing thanks! Not sure what I did wrong, but |
I just tried it and I get bad stdout data from snapclient, compared to using a file or fifo. Snapclient prints snapcast/client/snapclient.cpp Line 388 in 7eff45f
Tested with snapclient --logsink stderr --player file > file.raw I tried using -s null but still got the extra output. A quick workaround I found was to pipe it through tail -n +2 , which skips the first line of output.
|
Fixed with commit c88b2d1 |
Thanks, that |
Hello,
I've just learned about Snapcast, and this project is already running on my home server, phones & computers. This works just fine, thanks for developing this.
Here is a feature request: I need to read the audio stream, as snapclient would do, but then output the raw samples to stdout (instead of a sound card) so I can pipe it to another audio processing pipeline (say ffmpeg), with the end-goal of streaming to devices not supported by Snapcast today. One example that comes to mind is
As you can see, the missing element is
snapclient "raw mode"
, a snapclient that would output S16LE samples directly to stdout so I could pipe them. Could this be added to snapclient as one of the (currently undocumented)--player
? I've seen file_player.cpp but couldn't get it to output samples that ffmpeg could read (distorted audio).The text was updated successfully, but these errors were encountered: