Using AUDIO_S16LSB format, I got audio working in both iPad simulator, and
on iPad device using bluetooth audio (Jambox speaker)…
But when I unpair the Jambox, I do not hear audio from the iPad speaker!
I have killed the app, restarted the iPad, verified no bluetooth connected,
verified that iTunes plays music, restarted the app, still silent…
enumerating the devices all I have is:
- Audio device 0: System audio output device
code:
if (0 != SDL_InitSubSystem( SDL_INIT_AUDIO ))
{
printf( “couldn’t SDL_InitSubSystem( SDL_INIT_AUDIO )\n” );
exit(-1);
}
printf( "SDLAudioInterface: Initializing SDL Audio...\n" );
int count = SDL_GetNumAudioDevices(0);
for (int i = 0; i < count; ++i)
{
printf( "Audio device %d: %s\n", i, SDL_GetAudioDeviceName(i, 0) );
}
SDL_zero(want);
want.freq = 44100;
want.format = AUDIO_S16LSB;
want.samples = 256;
want.channels = 2;
want.callback = SDL_AudioCallback;
want.userdata = (void*)this;
dev = SDL_OpenAudioDevice(NULL, 0, &want, &have,
SDL_AUDIO_ALLOW_FORMAT_CHANGE);
if (dev == 0) {
printf(“Failed to open audio: %s\n”, SDL_GetError());
exit(0);
} else {
if (have.format != want.format) // we let this one thing change.
printf(“We didn’t get the requested audio format.\n”);
SDL_PauseAudioDevice(dev, 0); // start audio playing.
}On Fri, Nov 29, 2013 at 9:14 AM, Jeremy Jurksztowicz <jurksztowicz at gmail.com wrote:
In every audio app I have written, using every library (including SDL
a long time ago) there is a difference between simulator and device
performance. I think I had to tweak window size for some of them
(something SDL handles behind the scenes perhaps?), and sampling rate
for others. I’d recommend trying to output a pure sine at 440hz or
something recognizable and play with the various characteristics. In
my non SDL audio apps I have used 32 bit floating point samples on the
device successfully.
Wish I could more specifically address your problem, good luck!
Jeremy J.
On Fri, Nov 29, 2013 at 3:58 AM, kevin meinert <@kevin_meinert1> wrote:
Hi,
I got audio working with float32 format in the ipad simulator and on
MacOSX,
but when running on an actual iPad2 device I hear nothing. When running
the
mixer demo on the iPad device I do hear audio. The difference I can see
between my app and the mixer demo is that mixer demo is running as S16LSB
format while my app is running as F32 audio format… If I switch my
app to
S16LSB then I hear noise out the iPad device (I haven’t implemented
conversion from float to short yet, so it is pretty awful sounding at the
moment).
Is float 32 not supported on actual devices? It works well on the
simulator
and on MacOSX…
Thanks for any advice, google didn’t turn up any hints for me,
Kevin
Sent from my Windows Phone
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org