mirror of
https://github.com/obsproject/obs-studio.git
synced 2026-03-05 15:16:13 -05:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user