The default bug view has changed. See this FAQ.

nsAudioStream U8 sound format conversion incorrect

RESOLVED FIXED

Status

()

Core
Audio/Video
RESOLVED FIXED
6 years ago
5 years ago

People

(Reporter: cajbir, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
Found while working on bug 635649. The code to covert from U8 sound samples to S16 format is incorrect. Existing code is:

s_data[i + offset] = short(((PRInt32(buf[i]) - 128) * volume) >> 8);

For a U8 value of 255 this gives a result of 32512. It should give 32767.

Matthew Gregan suggested fixing it as part of the audio backend refactoring.
(Reporter)

Updated

6 years ago
Depends on: 623444
FORMAT_U8 conversion was removed from nsAudioStream in bug 775319.
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Depends on: 775319
No longer depends on: 623444
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.