https://lazyfoo.net/tutorials/SDL/34_au ... ording.zip
Он работает должным образом, за исключением действия «Воспроизведение» в разделе «ВОСПРОИЗВЕДЕНИЕ».
Следующий код включает основную функцию:
Код: Выделить всё
int main( int argc, char* args[] )
{
//Start up SDL and create window
if( !init() )
{
SDL_Log( "Failed to initialize!\n" );
}
else
{
//Load media
if( !loadMedia() )
{
SDL_Log( "Failed to load media!\n" );
}
else
{
//Main loop flag
bool quit = false;
//Event handler
SDL_Event e;
//Set the default recording state
RecordingState currentState = SELECTING_DEVICE;
//Audio device IDs
SDL_AudioStream *recordingStream = 0;
SDL_AudioStream *playbackStream = 0;
//While application is running
while( !quit )
{
//Handle events on queue
while( SDL_PollEvent( &e ) != 0 )
{
//User requests quit
if( e.type == SDL_EVENT_QUIT )
{
quit = true;
}
//Do current state event handling
switch( currentState )
{
//User is selecting recording device
case SELECTING_DEVICE:
//On key press
if( e.type == SDL_EVENT_KEY_DOWN )
{
//Handle key press from 0 to 9
if( e.key.key >= SDLK_0 && e.key.key
Подробнее здесь: [url]https://stackoverflow.com/questions/79203161/playback-action-does-not-play-the-recorded-audio-again-in-the-playback-section-o[/url]