My Cocos2dx game disrupts sounds of other sound-focused apps in iPhone - cocos2d-iphone

I've used CocosDenshion to play sound in my game. This is the code I used to load sound
CocosDenshion::SimpleAudioEngine::sharedEngine()->preloadEffect("sounds/tile_move.mp3");
and I've played sounds like this:
CocosDenshion::SimpleAudioEngine::sharedEngine()->playEffect("sounds/tile_move.mp3", 0);
When I tried to listen to a podcast app, and played my game It disrupts the podcast. Even when I mute sound from my game using this code:
CocosDenshion::SimpleAudioEngine::sharedEngine()->setEffectsVolume(0.0f);
The podcast sound still disrupts.
Can anyone help me with this problem?
Regards.

Related

OpenAL. MACOS. Capture and rendering from the same device (bluetooth headset)

Good day!
Our application should play the sound that came from the network from the server and collect sound from the user through a microphone and send it back to the server. For these purposes (render and capture) we use OpenAL. Everything works fine when we use the equipment built into the Mac. When we use bluetooth headphones that have microphone, problems arise. For example, Apple Airpods or Meizu POP.
If we use OpenAL implementation that Apple provides, there is no sound rendering at all. Device doesn't process sound data and alGetSourcei(/*our source*/, AL_BUFFERS_PROCESSED, &buffersProcessed) always set buffersProcessed in 0.
If we use OpenAL-Soft implementation, device process incoming data and we hear the sound. But this sound is muffled, with noises, like the sound from an old VHS video cassette.
Rendering and capture run in separate threads and device access is not synchronized. The logic for capturing and rendering is standard and done according to the OpenAL documentation.
Maybe someone has encountered such incorrect behavior? I will be glad of any help and questions.
Thanks!

How to render Spotify PCM stream on Windows

Currently I am trying to use the libspotify lib to write a Windows Spotify Player. I'm new to audio streaming but not to video streaming.
I have the basics working for most of the user data and track info but the problem I'm having is that I can't figure out how to render the Raw PCM data on Windows.
I've been looking at the Jukebox example but it doesn't compile on Windows and I would like to keep this app as a native Windows app. This example is using OpenAL to render the stream and just wondering if that the best solution (vs something like Windows Audio Session API).
Seems like playing back a track should be straightforward. Am I missing something? It's turning out to be quite difficult.
I did see this post which is a little discouraging.
Getting the examples in libspotify to work under Windows 7
Any help or direction on this topic would be very much appreciated! Working samples even better. :)

Beep() and/or windows error sounds won't play

Beep() stopped working, as in like it won't actually play the sound. I can't hear anything. Also error messages when compiling in VS (or error messages in general) does not play a sound.
This started happening yesterday, and I haven't changed anything. Every other sound on the computer works.
Anyone knows how the hell I can fix this? The default sound device is my headset as per usual, and no sound device is muted etc.
Edit: Also, it does not matter if I switch default sound device to something else. Every other sound keeps playing, but Beep/error messages refuses to play.
Edit2: Heck, even other windows sounds are working, even "start as admin" sound works. I have absolutely no clue what this is.
Thanks

Is there a Windows Media Player API or Multimedia API in Windows

I thought it would be fun to create an application that synchronizes few clients with a server to Play/Pause/Stop/Rewind/Forward or go to a given second of a movie on a existing (and running) Windows Media Player.
I googled for few hours to no avail. If that is the case, how are the multimedia keyboards (the ones with extra keys) managing to control WMP through their driver suite :O
I really want to keep it simple and I don't want to create WMP container application or something. Just a client application made in Qt that when receives a UDP packet would send Play/Pause or Stop signal to the player.
Further I could make my client application to wait until there is running WMP player.
Anyhow my question is ... do you guys have some tips or tricks on how should I do this or some resource to read the basics. I've never done something like that before and I don't really have much knowledge about process hooking and the likes. I really hope it doesn't come to that (crosses fingers). Please don't ask me why would I want to do something like that it's a really long story :) and it doesn't involve world domination in any way :P
P.S: As a finish I want to clarify. I'm aiming only Windows OS and only Windows Media Player. No other OS or multimedia player whatsoever. As I said, I would like to keep it simple :) Thank you in advance!
P.S: Security is not an issue since this application is only for my family

How can I play a synth sound in a C++ app on OSX?

I want to play instrumental sounds in my app. The duration of the sounds is flexible so MIDI seems the best solution.
I am using Open Framework for now.
Using Audio Units, I managed to process an input sound, not to play through an instrument.
I have found AUi instruments on my Mac but I don't know how to access them from my code.
I didn't find any way to play General Midi (built in MIDI instrument). No out port found with RTMidi.
Does anyone have a solution?
Thank you!
I found the solution in this project.
You need to use Audio Units.
Add a node with this component description:
description.componentType = kAudioUnitType_MusicDevice;
description.componentSubType = kAudioUnitSubType_DLSSynth;
description.componentManufacturer = kAudioUnitManufacturer_Apple;
description.componentFlags = 0;
description.componentFlagsMask = 0;
AUGraphAddNode (graph, &description, &synthNode);
Open and initialize your audio units and play the notes like that:
MusicDeviceMIDIEvent (synthUnit, channel, note, velocity, 0);