mritter0 wrote:
MultiViewer will play the FLACs.
Any ideas?
Easy one first, GID_MUSIC refers to a score, tab or other representation of the music, perhaps midi, though in reality midi datatypes are usually GID_SOUND. There isn't a base class for GID_MUSIC at the current time. If there wwere it would likely *display* the score so a musician could read and play it.
IN terms of why music files are soundf iles, there is no meaningful difference between the sound of a rock being banged repeatedly in rhythm and the sound of a landslide, except in the human brain.
Here's my sound player from AOrganiser. Note that I set the src type explicitly and a few other settigs.
I don't have any FLACS to test with or a FLAC datatype installed for that matter.
Code: Select all
case ALARM_SOUND:
{
if(al->al_Data.al_Sound.al_SoundFile)
{
/* skip alarm if we are playing one! */
/* at the moment we are single process so thos should be all we need */
/* if we add multi tasking then a semaphore might be required */
if(!diary->dd_CurrentSound)
{
diary->dd_CurrentSound = IDataTypes->NewDTObject(al->al_Data.al_Sound.al_SoundFile,
DTA_SourceType,DTST_FILE,
DTA_GroupID, GID_SOUND,
SDTA_Volume,64,
SDTA_Cycles,1,
SDTA_SignalTask, IExec->FindTask(NULL),
SDTA_SignalBitNumber,SIGBREAKB_CTRL_F,
TAG_DONE);
if(diary->dd_CurrentSound)
{
struct dtTrigger dtt = {0};
dtt.MethodID = DTM_TRIGGER;
dtt.dtt_GInfo = NULL;
dtt.dtt_Function = STM_PLAY;
dtt.dtt_Data = NULL;
IIntuition->IDoMethodA(diary->dd_CurrentSound,(Msg)&dtt);
}
}
}
break;
}
My main loop waits for the signal.
Code: Select all
if(sig & SIGBREAKF_CTRL_F)
{
/* the sound we were playing stopped */
if(diary->dd_CurrentSound)
{
IDataTypes->DisposeDTObject(diary->dd_CurrentSound);
diary->dd_CurrentSound = NULL;
}
}