Simple tone playback

Play tone for defined duration(in miliseconds; -1 for infinite duration).
#include <tone_player.h>
#include <sound_manager.h>
#include <dlog.h> // for logging purposes

int tone_player;

void
play_tone(int time) {
	int ret;
	ret = tone_player_start(TONE_TYPE_DEFAULT, SOUND_TYPE_MEDIA, time, &tone_player);
	if(ret == TONE_PLAYER_ERROR_NONE) {
		LOGI("Tone is playing...");
	}
//	To stop playback use:
//	tone_player_stop(tone_player);
}

Responses

0 Replies