int main (int argc, const char * argv[]) {
	
 	MyAUGraphPlayer player = {0};
	
	// create the input unit
	CreateInputUnit(&player);
	
	// build a graph with output unit
	CreateMyAUGraph(&player);
	
#ifdef PART_II
	// configure the speech synthesizer
	PrepareSpeechAU(&player);
	
#endif
	
	// start playing
	CheckError (AudioOutputUnitStart(player.inputUnit), "AudioOutputUnitStart failed");
	CheckError(AUGraphStart(player.graph), "AUGraphStart failed");
	
	// and wait
	printf("Capturing, press <return> to stop:\n");
	getchar();
	
cleanup:
	AUGraphStop (player.graph);
	AUGraphUninitialize (player.graph);
	AUGraphClose(player.graph);
	
	
}
예제 #2
0
int	main(int argc, const char *argv[])
{
 	MyAUGraphPlayer player = {0};
		
	// build a basic speech->speakers graph
	CreateMyAUGraph(&player);
	
	// configure the speech synthesizer
	PrepareSpeechAU(&player);
	
	// start playing
	CheckError(AUGraphStart(player.graph), "AUGraphStart failed");
	
	// sleep a while so the speech can play out
	usleep ((int)(10 * 1000. * 1000.));
	
cleanup:
	AUGraphStop (player.graph);
	AUGraphUninitialize (player.graph);
	AUGraphClose(player.graph);
	DisposeAUGraph(player.graph);
	return 0;
}