Inside my diago.Serve, I:
- accept a call
- create a
PlaybackControl
- read the negotiated codec via
pb.Codec()
- start ffmpeg (
ffmpeg -loglevel error -i ./audio.webm -ac 1 -acodec pcm_alaw -ar 8000 -f alaw pipe:)
- send the ffmpeg output with
pb.Play(r, "")
PCMA/PCMU streams have a bitdepth of 8. But pb.Play(r, "") interprets them as if they had a bitdepth of 16 because pb.BitDepth is set to 16 per default. When I set pb.BitDepth manually to 8 everything works as expected.
But since pb.BitDepth is commented as Read Only I am confused if this is the correct approach here or a bug.
Besides that small hiccup I really enjoy working with diago. Thank you for your awesome work!
Inside my
diago.Serve, I:PlaybackControlpb.Codec()ffmpeg -loglevel error -i ./audio.webm -ac 1 -acodec pcm_alaw -ar 8000 -f alaw pipe:)pb.Play(r, "")PCMA/PCMU streams have a bitdepth of 8. But
pb.Play(r, "")interprets them as if they had a bitdepth of16becausepb.BitDepthis set to16per default. When I setpb.BitDepthmanually to8everything works as expected.But since
pb.BitDepthis commented as Read Only I am confused if this is the correct approach here or a bug.Besides that small hiccup I really enjoy working with diago. Thank you for your awesome work!