Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
Is it possible to use TAudio with only a WAV file without using a Dataset ? |
Wed, Nov 28 2018 6:50 PM | Permanent Link |
Jose Verger Cybernav | Hello, I have a WAV file that has to be played as alarm when some conditions are met.
Is it possible to load such WAV file with the SourceURL property and play it ? Because when I try, it executes the Error event and does not play. regards |
Wed, Nov 28 2018 10:39 PM | Permanent Link |
Raul Team Elevate | <<
Cybernav wrote: Hello, I have a WAV file that has to be played as alarm when some conditions are met. Is it possible to load such WAV file with the SourceURL property and play it ? Because when I try, it executes the Error event and does not play. >> Yes. What does the error event actually say ? Raul |
Thu, Nov 29 2018 1:59 AM | Permanent Link |
Michael Dreher | Raul wrote:
// What does the error event actually say ? The TAudio.OnError event is of type TNotifyEvent and doen't give a hint. May be the browser environment does not support WAV (can be compressed too). IE for example does not support it, you will not hear it in the IDE. MIME type support can be tested with code like this: var Audio1 : TAudio; CAN_PLAY_MEDIA : array of string = ['cpmCannot', 'cpmMaybe', 'cpmProbably']; procedure TForm1.Button1Click(Sender: TObject); begin MultiLineEdit1.Lines.Add(CAN_PLAY_MEDIA[Audio1.CanPlayMedia('audio/mpeg')]); MultiLineEdit1.Lines.Add(CAN_PLAY_MEDIA[Audio1.CanPlayMedia('audio/ogg')]); MultiLineEdit1.Lines.Add(CAN_PLAY_MEDIA[Audio1.CanPlayMedia('audio/wav')]); end; My choice is MP3 format when possible. A compatibility list can be found for example here: https://www.w3schools.com/html/html5_audio.asp Michael Dreher |
Thu, Nov 29 2018 3:44 AM | Permanent Link |
Matthew Jones | Michael Dreher wrote:
> MIME type support can be tested with code like this: ALso note that the server may need to be updated to support some file types with the proper MIME type. We had this yesterday with a font. The Browser console may have a note telling you what the problem is too. -- Matthew Jones |
Thu, Nov 29 2018 10:30 AM | Permanent Link |
Jose Verger Cybernav | Michael Dreher wrote:
Raul wrote: // What does the error event actually say ? The TAudio.OnError event is of type TNotifyEvent and doen't give a hint. May be the browser environment does not support WAV (can be compressed too). IE for example does not support it, you will not hear it in the IDE. MIME type support can be tested with code like this: var Audio1 : TAudio; CAN_PLAY_MEDIA : array of string = ['cpmCannot', 'cpmMaybe', 'cpmProbably']; procedure TForm1.Button1Click(Sender: TObject); begin MultiLineEdit1.Lines.Add(CAN_PLAY_MEDIA[Audio1.CanPlayMedia('audio/mpeg')]); MultiLineEdit1.Lines.Add(CAN_PLAY_MEDIA[Audio1.CanPlayMedia('audio/ogg')]); MultiLineEdit1.Lines.Add(CAN_PLAY_MEDIA[Audio1.CanPlayMedia('audio/wav')]); end; My choice is MP3 format when possible. A compatibility list can be found for example here: https://www.w3schools.com/html/html5_audio.asp Michael Dreher Hello, You are correct, using MP3 instead of WAV solves the issue. Thanks very much |
This web page was last updated on Friday, November 1, 2024 at 07:01 PM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |