Skip to content
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

Offer audio in a standard audio streaming format #117

Open
bdn76 opened this issue Nov 9, 2018 · 11 comments
Open

Offer audio in a standard audio streaming format #117

bdn76 opened this issue Nov 9, 2018 · 11 comments

Comments

@bdn76
Copy link

bdn76 commented Nov 9, 2018

Nice replcament for proprietry websdr. Can i listen stream without open browser via common wide player, VLC for example.

@kpreid kpreid changed the title Listen stream via common wide player. Offer audio in a standard audio streaming format Nov 9, 2018
@kpreid
Copy link
Owner

kpreid commented Nov 9, 2018

Not currently possible — ShinySDR's audio stream is proprietary in the sense of "I made up the protocol and nobody else uses it". However, I have also thought it would be good to be able to just point a regular streaming audio player at a ShinySDR server. Thanks for making the issue.

This is not the same feature as #11, using WebRTC for to-browser streaming, but they might end up sharing some infrastructure.

@bdn76
Copy link
Author

bdn76 commented Nov 9, 2018

Cool. Thanks.

@kpreid
Copy link
Owner

kpreid commented Nov 10, 2018

I've got a working implementation. It's uncompressed audio just like the existing stream. The latency is high since the browser doesn't consider this realtime and buffers a lot.

Just need to put in a link to it — probably next to the existing audio controls. And test with more players.

… dropping the URL into the ones I have handy just says there's a format error or does nothing. Maybe I need to create a "playlist"? I seem to recall that has been a thing, but I haven't used streaming audio not-in-a-web-page much lately.

@bdn76
Copy link
Author

bdn76 commented Nov 10, 2018

Where i can get URL for stream?

@kpreid
Copy link
Owner

kpreid commented Nov 10, 2018

Sorry, I was unclear; the changes aren't pushed yet.

@kpreid
Copy link
Owner

kpreid commented Nov 11, 2018

As of commit 31fd6a7 this feature is in; the link is inside the client audio controls (a collapsible section in the left sidebar where the Spectrum/Map/Telemetry/… display toggles are).

However, it doesn't work very well. Of the software I have handy, only Chrome will play the audio. Firefox tries to download it, Safari and QuickTime Player show a generic error, iTunes does something else random.

Non-mutually-exclusive hypotheses:

  1. Streaming a WAV file is not well supported; I need use something normal like MP3 instead. (This requires integrating an audio encoder library.)
  2. There's something I need to do to tell Firefox, at least, that this is not a file to be downloaded. (Seems unlikely.)
  3. For the non-browsers, I need to serve a playlist file rather than raw audio.

@kpreid
Copy link
Owner

kpreid commented Nov 11, 2018

Any recommendations from people familiar with HTTP audio streaming would be welcome.

@bdn76
Copy link
Author

bdn76 commented Nov 12, 2018

Hmm... I'm do not see URL:

2018-11-12 09_17_16-shinysdr

Src up to date.

commit 7d89fb6
Author: Kevin Reid kpreid@switchb.org
Date: Fri Nov 9 08:28:15 2018 -0800

Implement audio streaming over HTTP.

Define a Resource that produces a streaming WAV, and add it to the
session as /<cap>/audio-stream.

The stream is not currently linked from anywhere.

@bdn76
Copy link
Author

bdn76 commented Nov 12, 2018

Ok. I'm reconstruct URL from source: .../audio-stream/mono?rate=11025 and test it in player. mpv, vlc and ffplay work fine but mono/stereo switch not work:

.../audio-stream/stereo?rate=11025
Playing: .../audio-stream/stereo?rate=11025
[ffmpeg/demuxer] wav: Ignoring maximum wav data size, file may be invalid
(+) Audio --aid=1 (pcm_f32le 2ch 11025Hz)
AO: [pulse] 11025Hz stereo 2ch float

.../audio-stream/mono?rate=11025
Playing: .../audio-stream/mono?rate=11025
[ffmpeg/demuxer] wav: Ignoring maximum wav data size, file may be invalid
(+) Audio --aid=1 (pcm_f32le 2ch 11025Hz)
AO: [pulse] 11025Hz stereo 2ch float
A: 00:00:06 / 00:00:09 (71%) Cache: 1s+179KB

MP3 would be better of course and variable bitrate must have for squelch interaction.

@bdn76
Copy link
Author

bdn76 commented Nov 12, 2018

After cache flushing i'm see URL link:

20181112132050

@kpreid
Copy link
Owner

kpreid commented Nov 12, 2018

mpv, vlc and ffplay work fine

Thanks for the report!

mono/stereo switch not work:

There is (currently) no mono/stereo switch; /mono and /stereo only mean anything in the test code you saw them in. You can configure the server for mono audio but if the server is stereo there is no mix-down feature for individual streams, currently.

MP3 would be better of course and variable bitrate must have for squelch interaction.

Indeed! I hope that integrating codecs will improve this and also the interactive stream — the WAV stream is just what was easy to put together.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants