jkytomaki / opensl-soundpool Goto Github PK
View Code? Open in Web Editor NEWA POC for OpenSL ES based replacement for Android SoundPool
A POC for OpenSL ES based replacement for Android SoundPool
What steps will reproduce the problem?
1. Test the current implementation with a medium volume (e.g. 0.5)
2. Test the current implementation with a low volume (e.g. 0.1)
What is the expected output? What do you see instead?
We expect the first test to be about 5 times louder than the second test. If
testing against the native SoundPool we would see this outcome. Instead, the
two tests have nearly the same volume.
A fix for this issue is easily made by replacing the code in
OpenSLSoundPool.cpp between lines 288 and 295 with the following:
// Convert requested volume 0.0 - 1.0 to millibels
if (volume <= 0.0f) {
volume = 0.001f; // Can't actually take the log of 0 so bump it up a bit
} else if (volume > 1.0f) {
volume = 1.0f;
}
SLmillibel newVolume = (SLmillibel) (1000.0f * log(volume));
I removed the three unused #defines in OpenSLSoundPool.h but maybe you'd rather
use the NDKSP_MIN/MAX_VOLUME #defines with the range checking code? This
requires the addition of #include <math.h> in OpenSLSoundPool.cpp but gives
much better volume scaling than the current implementation; almost exactly the
same as the native SoundPool does.
I guess I should also mention this lets you take out the minVolume and
maxVolume private variables of OpenSLSoundPool along with the code that
initializes them since they are also no longer used.
Original issue reported on code.google.com by [email protected]
on 15 May 2012 at 5:57
why
What steps will reproduce the problem?
1. use .ogg file to play
2.
3.
What is the expected output? What do you see instead?
the sound is noise
What version of the product are you using? On what operating system?
i9300
Please provide any additional information below.
I think the parameter should be config for .ogg file, but I didn't find it,
author, do you know which parameter should I modified for play .ogg file.
Thanks a lot!
Original issue reported on code.google.com by [email protected]
on 29 Dec 2013 at 4:39
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.