openal

How can I use AVAudioPlayer to play audio faster *and* higher pitched?

若如初见. 提交于 2019-12-04 04:38:55
Statement of Problem: I have a collection of sound effects in my app stored as .m4a files (AAC format, 48 KHz, 16-bit) that I want to play at a variety of speeds and pitches, without having to pre-generate all the variants as separate files. Although the .rate property of an AVAudioPlayer object can alter playback speed, it always maintains the original pitch, which is not what I want. Instead, I simply want to play the sound sample faster or slower and have the pitch go up or down to match — just like speeding up or slowing down an old-fashioned reel-to-reel tape recorder. In other words, I

How can I get the current sound level of the current audio output device?

时光毁灭记忆、已成空白 提交于 2019-12-03 03:46:46
I'm looking for a way to tap into the current audio output on a Mac, then return a value representing the current sound level. By sound level, I mean the amount of noise being generated by the output. I'm NOT asking how to get the current volume level of the output device. the following code is pulled from Apple's Sample AVRecorder … this particular bit of code acquires a set of connections from this class's movieFileOutput's connections methods, gets the AVCaptureAudioChannel for each connection, and calculates decibel power based upon that. i would presume that if you are looking for an

How to properly handle audio interruptions?

我的梦境 提交于 2019-12-03 00:52:55
I've created a OpenGL 3D game utilizing OpenAL for audio playback and experienceing a problem of losing audio if "Home" button is getting pressed before audio device is getting initialized. I tried to hook up to audio session interrupt handler, but my callback is never getting called. No matter if I minimize or maximize my application. My "OpenALInterruptionListener" is never getting called. What am I doing wrong? AudioSessionInitialize(NULL, NULL, OpenALInterriptionListener, this); void OpenALInterriptionListener(void * inClientData, UInt32 inInterruptionState) { OpenALDevice * device =

OpenAL - determine maximum sources

安稳与你 提交于 2019-12-02 19:23:06
Is there an API that allows you to define the maximum number of OpenAL "sources" allowed by the underlying sound hardware? Searching the internet, I found 2 recommendations : keep generating OpenAL sources till you get an error. However, there is a note in FreeSL (OpenAL wrapper) stating that this is "very bad and may even crash the library" assume you only have 16; why would anyone ever require more? (!) The second recommendation is even adopted by FreeSL. So, is there a common API to define the number of simultaneous "voices" supported? Thank you for your time, Bill deft_code update: I can't

iOS: Audio Units vs OpenAL vs Core Audio

早过忘川 提交于 2019-12-02 16:13:46
Could someone explain to me how OpenAL fits in with the schema of sound on the iPhone? There seem to be APIs at different levels for handling sound. The higher level ones are easy enough to understand. But my understanding gets murky towards the bottom. There is Core Audio, Audio Units, OpenAL. What is the connection between these? Is openAL the substratum, upon which rests Core Audio (which contains as one of its lower-level objects Audio Units) ? OpenAL doesn't seem to be documented by Xcode, yet I can run code that uses its functions. This is what I have figured out: The substratum is Core

How to program a real-time accurate audio sequencer on the iphone?

半世苍凉 提交于 2019-12-02 14:18:57
I want to program a simple audio sequencer on the iphone but I can't get accurate timing. The last days I tried all possible audio techniques on the iphone, starting from AudioServicesPlaySystemSound and AVAudioPlayer and OpenAL to AudioQueues. In my last attempt I tried the CocosDenshion sound engine which uses openAL and allows to load sounds into multiple buffers and then play them whenever needed. Here is the basic code: init: int channelGroups[1]; channelGroups[0] = 8; soundEngine = [[CDSoundEngine alloc] init:channelGroups channelGroupTotal:1]; int i=0; for(NSString *soundName in

Workaround for UnsupportedAudioFileException?

亡梦爱人 提交于 2019-12-02 08:14:58
问题 I'm in a very early stage of writing a small music/rhythm game in Java (via Slick framework, which in turns uses OpenAL, but that's probably irrelevant here). The game needs to read (and playback) several sound files in WAV format, but some of the files are throwing [javax.sound.sampled.UnsupportedAudioFileException] exceptions. at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1102) at org.newdawn.slick.openal.WaveData.create(WaveData.java:123) at org.newdawn.slick

Workaround for UnsupportedAudioFileException?

风流意气都作罢 提交于 2019-12-02 04:43:32
I'm in a very early stage of writing a small music/rhythm game in Java (via Slick framework, which in turns uses OpenAL, but that's probably irrelevant here). The game needs to read (and playback) several sound files in WAV format, but some of the files are throwing [javax.sound.sampled.UnsupportedAudioFileException] exceptions. at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:1102) at org.newdawn.slick.openal.WaveData.create(WaveData.java:123) at org.newdawn.slick.openal.SoundStore.getWAV(SoundStore.java:713) at org.newdawn.slick.openal.SoundStore.getWAV(SoundStore.java

Capturing Audio Out

﹥>﹥吖頭↗ 提交于 2019-12-01 11:06:10
I want to capture all audio that is played to the user (all sounds together). Currently I'm working on Windows but it would be nice if the code was cross-platform (but not necessarily). Is it possible to do it with OpenAL? How? Code examples would be great. Language: C++ The only way to do this I believe is to create a replacement audio device driver that receives all audio requests, and then forwards them to the original device driver. There are a number of existing applications that work in this way including Freecorder , MP3myMP3 Recorder , SoundTap and Wondershare to name but a few (Google

Capturing Audio Out

空扰寡人 提交于 2019-12-01 08:25:28
问题 I want to capture all audio that is played to the user (all sounds together). Currently I'm working on Windows but it would be nice if the code was cross-platform (but not necessarily). Is it possible to do it with OpenAL? How? Code examples would be great. Language: C++ 回答1: The only way to do this I believe is to create a replacement audio device driver that receives all audio requests, and then forwards them to the original device driver. There are a number of existing applications that