Implement a few more audio options/functions

Implement a few audio options in to the user interface as well as a few
inline audio functions in audio-io.h.

Make it so ffmpeg plugin automatically converts to the desired format.

Use regular interleaved float internally for audio instead of planar
float.
This commit is contained in:
jp9000
2014-02-23 16:27:19 -07:00
parent 0ff0d32731
commit c232ebde15
10 changed files with 311 additions and 54 deletions

View File

@@ -313,13 +313,23 @@ bool OBSBasic::ResetVideo()
bool OBSBasic::ResetAudio()
{
/* TODO: load audio settings from config */
struct audio_output_info ai;
ai.name = "test";
ai.samples_per_sec = 44100;
ai.format = AUDIO_FORMAT_FLOAT_PLANAR;
ai.speakers = SPEAKERS_STEREO;
ai.buffer_ms = 700;
ai.name = "Main Audio Track";
ai.format = AUDIO_FORMAT_FLOAT;
ai.samples_per_sec = config_get_uint(GetGlobalConfig(), "Audio",
"SampleRate");
const char *channelSetupStr = config_get_string(GetGlobalConfig(),
"Audio", "ChannelSetup");
if (strcmp(channelSetupStr, "Mono") == 0)
ai.speakers = SPEAKERS_MONO;
else
ai.speakers = SPEAKERS_STEREO;
ai.buffer_ms = config_get_uint(GetGlobalConfig(), "Audio",
"BufferingTime");
return obs_reset_audio(&ai);
}