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

flv: PCM audio is broken #16614

Open
onkrot opened this issue Jun 6, 2024 · 1 comment
Open

flv: PCM audio is broken #16614

onkrot opened this issue Jun 6, 2024 · 1 comment
Labels
A-audio Area: Audio bug Something isn't working

Comments

@onkrot
Copy link
Contributor

onkrot commented Jun 6, 2024

Describe the bug

Steps to reproduce:

  1. Generate a tone of 400 Hz sine wave (I have used this generator)
  2. Convert it to flv using FFmpeg with PCM 16 LE encoding ffmpeg -i output.wav -acodec pcm_s16le -ar 22050 -ac 1 a.flv
  3. Try to play it using local NetConnection, NetStream, and Video classes (see the attachment)

Expected behavior

Tone plays normally

Content Location

a.zip

Affected platform

Desktop app

Operating system

Windows 11

Browser

No response

Additional information

I found the bug when I tried to create a test for #16570. This problem also affects the proposed decoder.

Error logs suggest some underflow when only a portion of the audio stream gets decoded and played (happens when I replace PCM encoded flv with a-law encoded one)

2024-06-06T03:58:19.347628Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.347639Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.347641Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.347642Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.347643Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.383323Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.383335Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.383336Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.383337Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.383338Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.383339Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.384510Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.384519Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.384520Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.384521Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.384522Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.397256Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.397268Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.397270Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.397271Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.397272Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.418222Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.418242Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.418245Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.418248Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.418250Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.418253Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.432325Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.432339Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.432340Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.432341Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.432342Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.433408Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.433416Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.433417Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.433418Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.433419Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.462837Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.462850Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.462851Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.462852Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
2024-06-06T03:58:19.462853Z ERROR ruffle_core::streams: Error committing sound stream: Unknown codec
@onkrot onkrot added the bug Something isn't working label Jun 6, 2024
@torokati44 torokati44 added the A-audio Area: Audio label Jun 6, 2024
@torokati44
Copy link
Member

Generate a tone of 400 Hz sine wave (I have used this generator)
Convert it to flv using FFmpeg with PCM 16 LE encoding ffmpeg -i output.wav -acodec pcm_s16le -ar 22050 -ac 1 a.flv

FWIW, FFmpeg has a built-in signal generator, I used it to make the test inputs for #16526, like this for example:
ffmpeg -f lavfi -i "sine=frequency=444:duration=1:sample_rate=44100" -af "volume=5" -ac 2 -c:a aac tone_stereo_44100hz.flv

See: https://ffmpeg.org/ffmpeg-filters.html#sine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-audio Area: Audio bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants