| View previous topic :: View next topic |
| Author |
Message |
Fernand OOo Enthusiast

Joined: 22 Jun 2004 Posts: 142
|
Posted: Wed Oct 03, 2007 6:03 am Post subject: Playing Sound from within a basic macro |
|
|
Needs some starting hint or maybe som code
to start playing a embedded sound in a writer doc
thanks for any hints |
|
| Back to top |
|
 |
Fernand OOo Enthusiast

Joined: 22 Jun 2004 Posts: 142
|
Posted: Fri Oct 05, 2007 6:34 am Post subject: |
|
|
nobody ?
found out that xraying the embededobject returns a "nullobject" do that means that this objects not can been handled by the API ?
Fernand |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
Posted: Sat Oct 06, 2007 6:13 am Post subject: |
|
|
Hi,
this is tested on XP, other OSs may vary.
Precondition is that you inserted the sound by
Insert/Object/OLE Object/Further Objects/OK/Select file ...
See the code as a hint ...
Good luck,
ms777
| Code: | Sub Main
oEO = ThisComponent.EmbeddedObjects.getByIndex(0)
oXEO = oEO.ExtendedControlOverEmbeddedObject
oSupportedVerbs = oXEO.SupportedVerbs
s = ""
for k=0 to UBound(oSupportedVerbs)
s = s & "VerbID: " & oSupportedVerbs(k).VerbID & ", Name: " & oSupportedVerbs(k).VerbName & Chr(10)
next k
msgbox s
oXEO.doVerb(0)
End Sub |
|
|
| Back to top |
|
 |
Fernand OOo Enthusiast

Joined: 22 Jun 2004 Posts: 142
|
Posted: Mon Oct 08, 2007 12:14 am Post subject: |
|
|
Thanks it works
as we can expect from a superuser
you are a genious ! but where the hell you found this information ?
Thanks
Fernand |
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
Posted: Mon Oct 08, 2007 11:57 am Post subject: |
|
|
| Fernand wrote: | ... but where the hell you found this information ?
|
I first checked the three (?) different methods to insert an audio file, and checked by the file size, if the audio file was really inluded. Then XRay on the embedded object ...
Always glad to help,
ms777 |
|
| Back to top |
|
 |
Fernand OOo Enthusiast

Joined: 22 Jun 2004 Posts: 142
|
Posted: Mon Oct 08, 2007 11:37 pm Post subject: |
|
|
I only xrayed the first way to inserting, stupid me
Thanks again
Fernand |
|
| Back to top |
|
 |
Brivot General User

Joined: 08 Nov 2008 Posts: 9 Location: Côte d'Azur
|
Posted: Tue Mar 03, 2009 12:29 pm Post subject: Basic macro for sounds in OOBase Forms |
|
|
Do you think I could assign this code to a macro-button inside a OOBase Form and/or store sounds in the Database ? Could you provide general guidelines or code that you would think relevant ? Main problem is speed, each sound is a chinese caracter and last 1 second. How fast is your system running ?
I am also considering to do the opposite : embed sounds in the writer document in which I would include some access to chinese caracters from the database. Ths looks easier but less satisfactory than storing sound objects into the database itself.
I am only at the begining of the project and search for advices/guiline for sounds nevertheless all chinese characters are already stored with French translation.
Thanks for any help you could provide with.
Michel
| ms777 wrote: | Hi,
this is tested on XP, other OSs may vary.
Precondition is that you inserted the sound by
Insert/Object/OLE Object/Further Objects/OK/Select file ...
See the code as a hint ...
Good luck,
ms777
| Code: | Sub Main
oEO = ThisComponent.EmbeddedObjects.getByIndex(0)
oXEO = oEO.ExtendedControlOverEmbeddedObject
oSupportedVerbs = oXEO.SupportedVerbs
s = ""
for k=0 to UBound(oSupportedVerbs)
s = s & "VerbID: " & oSupportedVerbs(k).VerbID & ", Name: " & oSupportedVerbs(k).VerbName & Chr(10)
next k
msgbox s
oXEO.doVerb(0)
End Sub |
|
|
|
| Back to top |
|
 |
ms777 Super User


Joined: 07 Feb 2004 Posts: 1355
|
Posted: Tue Mar 03, 2009 1:10 pm Post subject: |
|
|
Hi,
getting the byte array of a sound from database and directly embedding as a sound into the doc or form I have no idea how to achieve ...
I would go through a Beanshell macro and use the Java AudioSystem functions. This has also the advantage of better portability
Good luck,
ms777 |
|
| Back to top |
|
 |
|