JoJoBond / 3LAS

Low Latency Live Audio Streaming
GNU General Public License v2.0
90 stars 23 forks source link

Native iOS audio without standby #19

Closed DaCHack closed 2 years ago

DaCHack commented 3 years ago

Hi,

is there a chance to avoid standby on iOS devices after a certain period independently from the users iOS settings? The stream always pauses when the screen goes dark.

I was thinking of providing the user with an additional audio stream that he/she can open directly in a native audio app when required such as VLC player. This way, the screen can go dark but audio will continue to play.

Maybe you can do it even with the HTML/JS-player but I could not find a way. DO you have an idea how to do this or recycle the server command for a suitable stream on a separate port?

#MP3
ffmpeg -y -f alsa -i hw:1 -rtbufsize 64 -probesize 64 \
-acodec libmp3lame -b:a 320k -ac 1 -reservoir 0 \
-f mp3 -write_xing 0 -id3v2_version 0 -fflags +nobuffer -flush_packets 1 - \
| node /home/3LAS/example/server/3las.stdinstreamer.js -port 9601 -type mpeg &
JoJoBond commented 3 years ago

Sadly there is not good way to influence the standby behaviour on iOS. I face the same issue in my application.

JoJoBond commented 3 years ago

You'd need something like Icecast server to do streaming "the other way", you can simply put the stream into an html audio tag. The only issue is the large latency.