Play FLAC songs with Datatypes
Posted: Sun May 14, 2017 3:45 am
I am adding support to play FLAC song files in my project. I use this code to play MP3s, but it will not play FLACs
It fails at the NewDTObject() function. The FLACs are being identified as 'Sound' (why aren't MP3s and FLACs considered 'Music'?). I also tried GID_MUSIC, same result.
MultiViewer will play the FLACs.
Any ideas?
Code: Select all
if ((SoundObject=IDataTypes->NewDTObject(SoundPath,
DTA_GroupID, GID_SOUND,
TAG_END)))
{
PreviewSoundSignal=IExec->AllocSignal(-1);
IDataTypes->SetDTAttrs(SoundObject,MainWindow,NULL,
SDTA_SignalTask, IExec->FindTask(NULL),
SDTA_SignalBitMask, 1L << PreviewSoundSignal,
TAG_DONE);
IDataTypes->DoDTMethod(SoundObject,NULL,NULL,DTM_TRIGGER,NULL,STM_PLAY,NULL);
SoundPlaying=TRUE;
}
MultiViewer will play the FLACs.
Any ideas?