-
Notifications
You must be signed in to change notification settings - Fork 118
Audio Playback
You can play audio files or stream audio through your Wyze camera's speaker using the cmd aplay
command.
To play a .wav audio file, use the command cmd aplay <path-to-file> <volume>
. The <volume>
parameter sets the playback volume.
For example:
cmd aplay /path/to/audio.wav 50
This plays the audio.wav
file at 50% volume.
If you have a .wav file that's not compatible, you can convert it using ffmpeg
:
ffmpeg -i input.wav -acodec pcm_s16le -ac 1 -ar 16000 output.wav
This command converts input.wav
into a format suitable for the camera.
To stream audio from an online radio station or other streaming sources, follow these steps:
-
Create a FIFO buffer:
mkfifo /opt/wz_mini/tmp/stream
-
Stream and convert the audio using
ffmpeg
:- For Wyze Cam V2:
ffmpeg -nostdin -f mp3 -i <stream-url> -c:a pcm_s16le -f s16le -ac 1 -ar 8000 pipe:1 > /opt/wz_mini/tmp/stream 2> /dev/null &
- For Wyze Cam V3:
ffmpeg -nostdin -f mp3 -i <stream-url> -c:a pcm_s16le -f s16le -ac 1 -ar 16000 pipe:1 > /opt/wz_mini/tmp/stream 2> /dev/null &
Replace
<stream-url>
with the URL of your audio stream. - For Wyze Cam V2:
-
Play the streamed audio:
cmd aplay /opt/wz_mini/tmp/stream 30 2> /dev/null &
This command plays the stream at 30% volume.
To stop the playback, terminate the ffmpeg
process and remove the FIFO buffer:
pkill ffmpeg
rm -f /opt/wz_mini/tmp/stream
These commands provide a flexible way to use your Wyze camera for audio playback, whether it's for playing specific audio files or streaming from online sources.