Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

audio: Add G.711 decoder #16570

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

audio: Add G.711 decoder #16570

wants to merge 2 commits into from

Conversation

onkrot
Copy link
Contributor

@onkrot onkrot commented Jun 2, 2024

https://en.wikipedia.org/wiki/G.711

Both a-law and mu-law implemented as lookup tables

@Croworbit
Copy link

is there content that this is used for?

@Dinnerbone
Copy link
Contributor

(or at least a crafted example so we can test with, please!)
Thank you!

@Lord-McSweeney
Copy link
Collaborator

Lord-McSweeney commented Jun 3, 2024

I don't think it should be added to the AudioCompression struct in SWF, since it should (?) only appear in FLVs- is there another way to add it?

@lvyitian
Copy link
Contributor

lvyitian commented Jun 4, 2024

I don't think it should be added to the AudioCompression struct in SWF, since it should (?) only appear in FLVs- is there another way to add it?

@Lord-McSweeney Same in 409a713#diff-00d1b36fa29c1b47759997928f850c8ff051e7bcbe201ab073f0f855f1d3ecdeR1029
This has actually already been discussed in https://discord.com/channels/610531541889581066/614855396468719619/1244921689221894174

@torokati44
Copy link
Member

At least I personally have changed my mind since then. Now I think it's fine. After all, we have also added H264 as VideoCodec...

@danielhjacobs danielhjacobs added the A-audio Area: Audio label Jun 5, 2024
@onkrot
Copy link
Contributor Author

onkrot commented Jun 6, 2024

Okay, this definitely needed more testing (see #16614)

@onkrot
Copy link
Contributor Author

onkrot commented Jun 6, 2024

FFmpeg commands for flv encoding
A-law: ffmpeg -i output.wav -acodec pcm_alaw -ar 8000 -ac 1 a.flv
Mu-law: ffmpeg -i output.wav -acodec pcm_mulaw -ar 8000 -ac 1 m.flv

@torokati44
Copy link
Member

I'm still unable to make a passing test for this.

This is what FP plays the tone as:
image

And this is what this PR currently plays it as:
image

Maybe the FLV parser doesn't feed the decoder enough data...?

Could the same thing be causing the fairly common "MP3 decoder buffer underrun" errors?

I've also noticed that a decoder is being recreated for each "packet", which is probably not optimal...?

Pinging @kmeisthax.

@torokati44 torokati44 removed the waiting-on-review Waiting on review from a Ruffle team member label Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-audio Area: Audio T-compat Type: Compatibility with Flash Player
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants