Giter Site home page Giter Site logo

opensl-soundpool's People

Contributors

jkytomaki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

elix22 lask3802

opensl-soundpool's Issues

Incorrect Volume Scaling

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

play .ogg file issue

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.