Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 17 of 17 total
Thread Trying to play a recording with TAudio
Tue, Sep 15 2015 11:23 PMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 9/15/2015 9:54 PM, David Martin wrote:
> Maybe I am wrong, but I think it is the same thing. Maybe Tim can settle this.

Can you inspect the data you're assigning - what does it actually look
like ?

Unless i misunderstood OP you are assigning the actual bytes of the mp3
file stored as a blob to the URL property. So your data might looks
something like this "SUQzAwAAAAARYlRFTkMAAAARAAAAaVR1bmVzIHY3LjYuMC... "
when served up from server.

EWB sample assigns a URL to the audio file (i.e. the data it assign
looks like
"http://www.elevatesoft.com:8081/multimedia/datasets?dataset=Tracks&method=load&column=Sample&row=7;1&AlbumNo=7)


Raul

Wed, Sep 16 2015 1:19 AMPermanent Link

David Martin

Raul wrote:

<<Unless i misunderstood OP you are assigning the actual bytes of the mp3 file stored as a blob to the URL property.>>

You understood correctly. I have used the same type of assignment to load graphic images into a TSlideShow. I was surprised that it worked, but it did.

DM
Wed, Sep 16 2015 8:30 AMPermanent Link

Raul

Globestar Systems

Team Elevate Team Elevate

On 9/16/2015 1:19 AM, David Martin wrote:
> You understood correctly. I have used the same type of assignment to load graphic images into a TSlideShow. I was surprised that it worked, but it did.

TAudio is a wrapper around the HTML5 audio tag and looking at the
resulting elements with the browser debug tools the "Source URL" is
mapped into the "src" element.

As per HTML5 spec "src"
(http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-audio-element)
has to be a valid URL.

The spec also allows use of a a "source" element but in that case it's
still a URL that's needed (in addition to type) and same goes for
"track" element (again URL only).

We'll see what Tim says but I'm not seeing anything in HTML5 spec for
this that would allow loading anything other than a valid URL value
(i.e. direct bytes are not supported).

Raul
Wed, Sep 16 2015 9:21 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

David,

<< I did not have a Recording_ContentType field (as in the multimedia example) since it was never used in the example. Nevertheless, I have added a Recording_ContentType field with string value 'audio/mpeg'. But I still get the same message as above. Seems like the problem is Content-Type being 'text/plain' when it should be 'audio/mpeg.' Any recommendations on what to try next? Thanks. >>

Can you email me your DBISAM table ?  I'll try it here and see if I can find out what is going wrong.

BTW, there *is* a bug in the TAudio/TVideo controls when ShowControls=True.  Under IE, the browser player controls are not clickable.

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Sep 16 2015 9:04 PMPermanent Link

David Martin

Tim Young [Elevate Software] wrote:

<<Can you email me your DBISAM table ?  I'll try it here and see if I can find out what is going wrong.>>

I imported the MP3 file I am trying to play into the Tracks dataset of the supplied multimedia example and it plays the MP3 fine, even in the IDE browser. So let me try a bit more and if I still can't get it to work, then I'll hit you up.

Best,
DM
Fri, Sep 18 2015 3:35 PMPermanent Link

David Martin

Found a fix, though I am not sure why it worked. The table with the MP3 blob had as its primary key an index based on the auto-generated RecordID field. Since the table had an AutoInc field called PrimaryID, I altered the table so that the primary key uses PrimaryID as the indexed field rather than RecordID. Now the code worked as expected.

To Raul, I can confirm that the MP3 blob field can be directly assigned to the TAudio.SourceURL property. EWB seems to then auto-magically generate the appropriate server call to load the data into the client. Pretty cool.

DM
Mon, Sep 21 2015 10:29 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

David,

<< Found a fix, though I am not sure why it worked. The table with the MP3 blob had as its primary key an index based on the auto-generated RecordID field. Since the table had an AutoInc field called PrimaryID, I altered the table so that the primary key uses PrimaryID as the indexed field rather than RecordID. Now the code worked as expected. >>

This is a DBISAM-ism: EWB uses Locate with DBISAM tables in order to handle searching for records with BLOB loads and updates, and can't use Locate with the special system RecordID field.  I'll have to make a FAQ item about this.

<< To Raul, I can confirm that the MP3 blob field can be directly assigned to the TAudio.SourceURL property. EWB seems to then auto-magically generate the appropriate server call to load the data into the client. Pretty cool.  >>

Yep, that's how it works.  It kind of just "punts" and lets the browser/MIME types do the interpretation, so it can handle anything the browser can handle in terms of plugins, etc.  (although, plugins are slowly but surely dying off...)

Tim Young
Elevate Software
www.elevatesoft.com
Previous PagePage 2 of 2
Jump to Page:  1 2
Image