Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Streaming audio in APEX? (not downloading)

DirdFeb 14 2013 — edited Feb 14 2013
Hi guys,

I was wondering if anyone knows the technique to stream audio in APEX? I've got it working with basic HTML referencing my file on Dropbox at home but Dropbox is blocked at work so I can't do this. I've hosted it on the server with the APEX DB (In a directory called dird) and I've also loaded it into the DB (although I don't know if it was successful). The examples of dealing with BLOBs online all seem to be exporting to the filesystem again rather using it in a webpage. I don't want to download the file, I want to use it in an embed/HTML 5 audio audio tag. Can I refer to the database server's directory for the file? Or If I move the music file to #IMAGES# directory on the HTTP server then can I do src="#IMAGES#jap4.3gpp"? So far I've done the following:
create table help.audio (
aud_id number,
aud_name varchar2(100),
aud_data blob,
CONSTRAINT audio_PK PRIMARY KEY (aud_id)
);

DECLARE
  l_bfile  BFILE;
  l_blob   BLOB;
BEGIN
  INSERT INTO help.audio (aud_id, aud_name, aud_data)
  VALUES (1, 'Japanese 4', empty_blob())
  RETURN aud_data INTO l_blob;

  l_bfile := BFILENAME('DIRD', 'jap4.3gpp');
  DBMS_LOB.fileopen(l_bfile, Dbms_Lob.File_Readonly);
  DBMS_LOB.loadfromfile(l_blob, l_bfile, DBMS_LOB.getlength(l_bfile));
  DBMS_LOB.fileclose(l_bfile);

  COMMIT;
END;
Mike
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 14 2013
Added on Feb 14 2013
0 comments
229 views