Simple wav file playback

Play wave from defined filepath.
#include <tone_player.h>
#include <sound_manager.h>
#include <dlog.h> // for logging purposes

int wav_player;

void
play_wav(const char* path) {
	int ret;

	ret = wav_player_start(path, SOUND_TYPE_MEDIA, NULL, NULL, &wav_player);

	if(ret == WAV_PLAYER_ERROR_NONE)
		LOGI("Playing: %s", path);
//	To stop playback use:
//	wav_player_stop(wav_player);
}

Responses

0 Replies