ruuda / hound

A wav encoding and decoding library in Rust
https://codeberg.org/ruuda/hound
Apache License 2.0
491 stars 65 forks source link

support mulaw format #78

Open xd009642 opened 4 months ago

xd009642 commented 4 months ago

So mulaw is still commonly used in domains like telephony and I found recently when integrating with some voip platforms that hound doesn't support the sample format. mulaw is basically a sigmoidal instead of linear curve on the samples so data towards the middle ranges is more accurately encoded than at the edges meaning you can approach 16 bit quality while just using 8 bit via a lossy compression. There's no state tracking so I guess just a wrapper type could suffice.

I think only 8 bit and 16 bit mulaw are common so there's no need to go further than that and cover a mulaw version of every integer sample format but I can look deeper into it. I've only personally seen 8 bit mu law.

Other relevant issue would be the adpcm one given this is another different sample format: https://github.com/ruuda/hound/issues/45

Example wav file which is just a short amount of silence silence.zip