Skip to content

invalid bitdepth when sending raw PCMA/PCMU stream (Expose Playback API with Bit Depth change) #127

@bits0rcerer

Description

@bits0rcerer

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions