Home | History | Annotate | Download | only in audio

Lines Matching refs:desired

397 int SDL_OpenAudio(SDL_AudioSpec *desired, SDL_AudioSpec *obtained)
417 if ( desired->freq == 0 ) {
420 desired->freq = SDL_atoi(env);
423 if ( desired->freq == 0 ) {
425 desired->freq = 22050;
427 if ( desired->format == 0 ) {
430 desired->format = SDL_ParseAudioFormat(env);
433 if ( desired->format == 0 ) {
435 desired->format = AUDIO_S16;
437 if ( desired->channels == 0 ) {
440 desired->channels = (Uint8)SDL_atoi(env);
443 if ( desired->channels == 0 ) {
445 desired->channels = 2;
447 switch ( desired->channels ) {
457 if ( desired->samples == 0 ) {
460 desired->samples = (Uint16)SDL_atoi(env);
463 if ( desired->samples == 0 ) {
464 /* Pick a default of ~46 ms at desired frequency */
465 int samples = (desired->freq / 1000) * 46;
470 desired->samples = power2;
472 if ( desired->callback == NULL ) {
490 SDL_CalculateAudioSpec(desired);
493 SDL_memcpy(&audio->spec, desired, sizeof(audio->spec));
506 if ( audio->spec.samples != desired->samples ) {
507 desired->samples = audio->spec.samples;
508 SDL_CalculateAudioSpec(desired);
522 } else if ( desired->freq != audio->spec.freq ||
523 desired->format != audio->spec.format ||
524 desired->channels != audio->spec.channels ) {
527 desired->format, desired->channels,
528 desired->freq,