DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

oduce .mp3 file from DIAdem script

Hi everyone. Just a quick question.
Is there a way to reproduce an audio file (let's say an mp3 or equivalent) directly from script, without opening it in View?

Thanks a lot!

0 Kudos
Message 1 of 7
(3,039 Views)

Hi Marco,

 

By "reproduce" do you mean play the sound through the computer speakers, or do you mean create a new audio file on the hard drive, or do you mean create a graph of the sound as a picture file?

 

Brad Turpin

Senior Technical Support Engineer

National Instruments

0 Kudos
Message 2 of 7
(2,976 Views)

Hi Brad.

I mean playing it onto the speakers.

Marco

0 Kudos
Message 3 of 7
(2,959 Views)

Hi Marco,

 

You can interactively select a waveform in the Data Portal, and as long as it has "s" for the X axis unit, it will play over the speakers, but I don't know of a way to make that happen from a script.  I think your only option is to secretly create a VIEW tab and control the waveform there, ideally without showing VIEW, then delete the VIEW tab afterwards.

 

Brad Turpin

Senior Technical Support Engineer

National Instruments

0 Kudos
Message 4 of 7
(2,946 Views)

Hi again Brad,

That's the solution i came up with too. Thanks a lot!

Regards and have a nice day!

Marco

0 Kudos
Message 5 of 7
(2,937 Views)

Hi Marco,

 

You can also try this here:

 

Load the example dataset and run this script commands

 

Portal.Structure.Activate
Portal.Structure.Selection.RemoveAll
Portal.Structure.Selection.Add(Data.Root.ChannelGroups(2).Channels(2))
Portal.ChannelPreview.Expand(true)
Portal.ChannelPreview.SoundState(TRUE)

 

Greetings

Walter

0 Kudos
Message 6 of 7
(2,933 Views)

Hi Walter,

 

Thank you for finding this code!  That's what I was looking for, and I guess I must have given up too easily.  I see it now in the object tree.

 

This should be way better than manipulating VIEW.

 

Brad Turpin

Senior Technical Support Engineer

National Instruments

 

0 Kudos
Message 7 of 7
(2,923 Views)