Java playback of multiple wav files in sequence - without overlap
Hi there
I am asking for suggestions on how to do simple consecutive playback of multiple wavefiles using java. Right now I have each wavefile loaded into a clip, and the playback almost works, but with occasional errors where two or more of the files are played back simultaneously. I am doing busy-waiting using the clip.isActive() method in a while-loop in order to detect when a clip has finished playing so that the next one can start. I know that there are most likely some smarter methods of doing this, and I have tried some of them - e.g. linelistener but without getting it to work. If anyone can supply me with some example code on how to do this the right way, or could point me to some literature, it would be greatly appreciated.
Thx in advance.
Jacob
http://www.jsresources.org/examples/SimpleAudioPlayer.html
That example plays a file by opening it with an AudioInputStream and copying the contents to a SourceDataLine to play it...
It can be easily modified to allow for multiple files to be opened & copied to a single SDL, and is what I'd consider the "proper" way to do it. Clips are mostly useful for things like making a button go "beep" and things of that nature. Not especially useful for normal multimedia applications.
Similar Messages
-
How can I merge multiple wav files in Premiere?
Hi Everyone,
So after I import my synced timeline from Plural Eyes and replace the audio clips I notice that the new XML file has multiple wav files for each of my cameras. I do know that dragging these wav files together increases the gain. Is there a way to have these wav files joined to make one solitary track and file with only one level? TIA
Mike DiazThe best method I can think of is to skip PluralEyes and all the issues that come with it.
1. Create a sequence matching your media.
2. Add the clips, sync manually.
3. Create a second sequence matching your media.
4. Nest the first sequence into the second.
5. Right click that nested sequence, choose Multi-Camera>Enable. -
Read & Filter Multiple .wav files, Export Filtered SPL
Hi
I'm searching for tips on how to use LabVIEW to read multiple .wav files, then filter them, then export just the calculated SPL values to a "database friendly format".
Basically I want a solution that allows me to point to several files, then press a "go button" that triggers LabVIEW to produce filtered SPL values as exported data.
I'll skim over the cal approach since I'm confident most readers know how to handle it. Basically, though, for each 30 s .wav file of broadband noise, an associated cal tone file is used to determine the dBFS value (dB below Full Scale) to be associated with 94 dB SPL, or 114 dB SPL, as the case may be. I'll leave it at that.
Detailed Requirements, (excluding cal steps, tho).
1) Operates on up to a dozen 30 s time records (44,1 kSa/s, mono .wav files);
2) Passes the signal from each desired .wav file through 18 of the 1/3 octave filters (IEC 1260 compliant, as in the S/V toolset) not necessarily in real time!;
3) Calculates the SPL for each 1/3 octave filtered time record; This makes (12 files) x (18 filters) = 216 filtered SPL values if end-user points to a dozen broadband noise files before pressing the "Go" button;
4) Exports SPL values in a suitable database format; an existing database does the rest of the mathematics and report generation;
Client FileMaker database functions include:
- import and store 1/3 octave filtered Leq(30) SPL values;
- average filtered SPL across the declared qty of mic positions of the present test case;
NOTES:
1) In the field, we do NOT use simultaneous / MULTI-mics. Instead, it is absolutely an "open and shut case" that the optimum process is to move one (1) single mic quickly from spot to spot. While holding the airborne noise at a constant level we position the mic at each spot for 30 s to feed the .wav recorder, then move on. We emerge from a typical day of field activity with, say, 60 to 100 .wav files to post-process.
2) (1), above, explains why we don't use any N.I. DAQ h/w.
3) LabVIEW, it seems, exports best to a spreadsheet, so if needed, I'm prepared to handle manually any ugly conversion from LV's format to a proper database format ("1st Normal Form, 2nd Normal Form, etc.).
4) Given a choice to calculate the averages in my database, versus in LV (say, to cut down on exported data qty), I'd likely opt to export the 216 SPL's and then do averaging in the database, (where the ASTM E336 reports are done).
TIPS Gathered To Date:
1) S/V toolset has IEC 1260 compliant filters, BUT...
2) If you use the S/V toolset VI's, then you CANNOT ACCESS the filtered time record NOR CAN YOU WRITE the filtered data back to a .wav file! All you can do is measure the filters' outputs. Fortunately for us here, the available measures include SPL.
Aside: Although not a show-stopper in this project, this constraint is surprising, nonetheless. To access & record the filtered sound, you'd have to either (a) ask N.I. to unprotect VI's, or (b) develop your own IEC compliant filters from N.I.'s published tap co-eff's etc.;
3) LabVIEW does not support drag'n'drop operations on files. Instead, the recommended technique is to use multiple "Browse to/ Navigation/ File Open" panels to allow LV to open the user's desired qty of .wav files simultaneously;
Thanks for any tips!The filter VI is password protected in the Sound & Vibration Toolkit (SVT) for two reasons. First, since the filter is compliant to a standard, by locking the code we guarantee that no one has the chance to accidentally change it so that they are no longer compliant. Second, the method of filtering the data is considered intellectual property that we are protecting.
That said, from reading your post it does not appear that you need to have access to the filtered data since you are making an SPL measurement which is provided in the Sound & Vibration functionality. Is that correct?
Also, I wanted to point you to another subVI which comes with SVT but is not in the pallette that might be of use. There is an example for SVT which is SVXMPL_Wav Power Spectrum which opens up a wav file and computes the power spectrum of it. Inside the VI, there is a subVI which will open a Wav file and convert it into a waveform which you can use with your SVT functions.
Hope that helps,
Jack -
How to create java classes when multiple xsd files with same root element
Hi,
I got below error
12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. 'resultClass' is already defined
12/08/09 16:26:38 BST: [ERROR] Error while parsing schema(s).Location []. (related to above error) the first definition appears here
12/08/09 16:26:38 BST: Build errors for viafrance; org.apache.maven.lifecycle.LifecycleExecutionException: Internal error in the plugin manager executing goal 'org.jvnet.jaxb2.maven2:maven-jaxb2-plugin:0.7.1:generate': Mojo execution failed.
I tried genarate java classes from multiple xsd files, but getting above error, here in .xsd file i have the <xe: element="resultClass"> in all .xsd files.
So I removed all .xsd files accept one, now genarated java classes correctly. but i want to genarte the java classes with diffrent names with out changing .xsd
Can you please tell me any one how to resolve this one......
regards
prasad.nadendlaGregory:
If you want to upload several Java classes in one script the solution is .sql file, for example:
set define ?
create or replace and compile java source named "my.Sleep" as
package my;
import java.lang.Thread;
public class Sleep {
public static void main(String []args) throws java.lang.InterruptedException {
if (args != null && args.length>0) {
int s = Integer.parseInt(args[0]);
Thread.sleep(s*1000);
} else
Thread.sleep(1000);
create or replace and compile java source named "my.App" as
package my;
public class App {
public static void main(String []args) throws java.lang.InterruptedException {
System.out.println(args[0]);
exit
Then the .sql file can be parsed using the SQLPlus, JDeveloper or SQLDeveloper tools.
HTH, Marcelo. -
UCCX single play prompt step for multiple wav files
Hi there!
Is possible to use single 'Play Prompt' step to play a chain of .wav files on UCCX?
For example, have variable chain_audio that can contain different content length
ex:
chain_audio = "P[1.wav] P[2.wav] P[3.wav]"
chain_audio = "P[1.wav] P[2.wav] P[3.wav] P[4.wav] P[5.wav]" etc.
Play Promtp (-Triggering Contact-, chain_audio)
Is it supported?
ThanksI'm not sure it is possible to call and fill Create Container within Java code. It is possible to setup variables by hand in Create Container Prompt step, like in Play Prompt step.
Parse a String to Array and fill up Create Container Prompt with Array elements manually. In my example i have only 4 elements, but in real world i could have more than 15 elements.
I wish Play Prompt/Create Container was filled automatically with chain of audio files, because it is impossible to know the array size beforehand. -
HT1338 Safari/Bonjour won't save .wav files to desktop without adding .html
I use the Dragon Dictate 3.4.0 with the Dragon Recorder app on my iPhone 5 (iOS7.0.4). This app allows for me to use a wifi connection to upload dictation (.wav) to the Mac. The instructions using Safari and Bonjour are simple to follow. However, when I right-click to save the .wav file Safari/Bonjour adds the extension .html to the file. This makes it unable to be read as a .wav file by Dragon transciption. I don't have this problem when following the instructions for using an alternate browser, in this case Firefox. The problem with using Firefox is the number of steps involved. It should be less cumbersome and using Safari/Bonjour would make it so.
Why is the .html extension being added to a .wav file when asking Safari to save it?
JerryDoes the ext directory have the php_oci8.dll? In the original steps the PHP dir is renamed. In the given php.in the extension_dir looks like it has been updated correctly. Since PHP distributes php_oci8.dll by default I reckon there would be a very good chance that the problem was somewhere else. Since this is an old thread I don't think we'll get much value from speculation.
-- cj -
Sluggish playback with multiple ProRes files
So here is what i currently have, macbook pro 2.4ghz, 6gb RAM, GeForce 8600M GT GPU, 500gb internal HD 140GB free, 2TB GRaid 1TB free via a Sonnet TempoPro Esata card.
Im doing a multi clip edit and i cant even play the footage back, the hard drive sounds like its cant keep up but i thought esata could handle more then that, am i wrong? I have 3 angles 2 originally HDV transcoded to ProRes SD and 7D footage done the same way. Everything 1440x1080. I set it to unlimited RT, Safe, i tried dynamic, low playback settings and everything and it just freezes up. Any help appreciated.CAMERA MAN 2007 wrote:
anyone?
Probably not. You need to talk to the card and the drive mfrs to figure out how to debug their hardware to work with your software.
ProRes is specifically designed to handle these situations so, umm, you've got to take it back to the start, reset. Make sure you've actually done the conversions properly. Heck, take it down another notch. Not much help but I'm up late and that's all I can think of.
You can try searching the forum for the drive and the card, maybe. See if anyone has ever tried to use them with your machine.
bogiesan -
Why do I get multiple class files from 1 java file?
I wrote a dialog box using gridBagConstraints and another program RunPanel to run it as a java application. For the first time since playing with java, I get multiple class files from a single java file.
This seems very strange to me and wonder if anyone else has come across this and what could possibly be the reason for it. I did a clean (in Eclipse) just to make sure it wasn't garbage and sure enough they come back again.
I have ReconPanel.java from which I get ReconPanel.class with the addition of ReconPanel$N.class where N goes from 1 to 5.
The same thing in RunPanel but here there is only 1 extra file, RunPanel$1.class.
I'll include the code for RunPanel since it is relatively small:
package ilan;
import javax.swing.JFrame;
public class RunPanel extends JFrame {
private static final long serialVersionUID = 1L;
private ReconPanel m_reconPanel = null;
public RunPanel() {
super();
initialize();
* This method initializes this
private void initialize() {
this.setTitle("tester");
this.setSize(new java.awt.Dimension(138,396));
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
m_reconPanel.exitPanel();
System.exit(0);
m_reconPanel = new ReconPanel();
this.getContentPane().add(m_reconPanel);
* @param args
public static void main(String[] args) {
JFrame frame1 = new RunPanel();
frame1.setVisible(true);
} // @jve:decl-index=0:visual-constraint="10,10"The only thing "unusual" I do is to put a listener on the WindowClosing so that I can go back to ReconPanel and write results to the registry.
Can anyone tell me what is going on?
Thanks,
IlanHe IIan,
Yes, you get number of extra class files based on your number of anomyous class es used. Like in your RunPanel, you get only 1 ..$1.class file, b'coz u have used only 1 annomyous class & i.e WindowAdapter. Take a look at this code :-
this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
m_reconPanel.exitPanel();
System.exit(0);
});Similarly, in your ReconPanel, you must have used such kind of classes 5 times, & hence u get such 5 extra classes. To avoiod such extra classes, if you can directly implement that interface or extend the class, if possible will be best. For example, for each button, u write
button1.addActionListener(new ActionListener() {
// Code
});Instead, of this, its better to implement ActionListener & write
button1.addActionListener(this);
public void actionPerformed(ActionEvent ae) {
if (ae.getSource() == button1) {
// CODE
}Likethis, you can get rid of such numerous extra class files. In IDE, if you ask to add actionEvent, it will do the first method. To get rid of it, don't add event in the properties, instead, apply the second method. The same thing applies for anyother event. The first option is worthful, if by implementing, u got to write 5 functions from which u r gonna use just 1 method.
Hope this clears your question.
Trupti -
Kind of a weird idea, but I'd like to see if it would be
possible to "assemble" a WAV file (using CF) from smaller WAV
files.
My idea: We report of the heights of rivers across the U.S.
(as in, at this moment, the Potomac River is 5.45 feet). I am able
to have people send in an email asking for a certain river, and CF
produces an email back to them with the river height (process runs
every 5 minutes).
But I thought of sending them back a voice (WAV) file to
their cell phones, so they could hear the river height instead of
using a text email. I thought if I could have a library of small
WAV files for each number, a "point", and some words, maybe I could
combine the needed pieces from multiple WAV files:
"Potomac" + "Height is" + "5" + "point" + "4" + "5" + "feet"
Somehow join those little WAV files into a single WAV file:
"Potomac height is 5 point 4 5 feet"
I can't believe CF could join these files, but if anyone has
any ideas, please let me know!
Thanks....Is there any shareware online that lets you merge wav files?
I would imagine you could string the phrases and send them to
the program
with <cfexec> or something, haven't looked into it
myself, but it sounds
like a interesting idea...
"Howard Perlman" <[email protected]> wrote
in message
news:f3h85b$jba$[email protected]..
> Kind of a weird idea, but I'd like to see if it would be
possible to
> "assemble"
> a WAV file (using CF) from smaller WAV files.
>
> My idea: We report of the heights of rivers across the
U.S. (as in, at
> this
> moment, the Potomac River is 5.45 feet). I am able to
have people send in
> an
> email asking for a certain river, and CF produces an
email back to them
> with
> the river height (process runs every 5 minutes).
>
> But I thought of sending them back a voice (WAV) file to
their cell
> phones, so
> they could hear the river height instead of using a text
email. I thought
> if I
> could have a library of small WAV files for each number,
a "point", and
> some
> words, maybe I could combine the needed pieces from
multiple WAV files:
> "Potomac" + "Height is" + "5" + "point" + "4" + "5" +
"feet"
>
> Somehow join those little WAV files into a single WAV
file:
> "Potomac height is 5 point 4 5 feet"
>
> I can't believe CF could join these files, but if anyone
has any ideas,
> please
> let me know!
> Thanks....
> -
I Am Using Photoshop CS5 - I Used To Be Able To Open Multiple Single Files - Now They Just Overlap As One File ! - How Can I Fix This Or Reboot My App To My Original Settings ?
In Preferences UNcheck Open Documents as Tabs
-
Wav file gets out of sync with sequence
Hello,
I have a 30min sequence that I sent the dialogue to an audio engineer for clean up as an OMF. He sent it back and it gets out of sync about the first 2 minutes or so. By the 30th minute the audio is out of sync about 47 frames.
I've tried multiple things, couple of observations: the WAV file's waveforms in the timeline show that all audio is in sync, yet when I playback in the timeline audio its out of sync. I even opened up the wav file on Quicktime player and timecodes from quicktime player and my video timeline do match, its only when i place the wav file in the timeline that it appears out of sync.
I've sent the whole sequence to Soundtrack Pro as a multitrack project. When I playback there it is in sync with the video!!! I export back and still same issue...
Editing on a Macbook Pro OS X 10.8.4 2.6GHZ Intel Core i7 on FCP 6.0.6.
The sequence settings: Apple ProRes HQ 25fps. Audio settings: 48 KHz, 16-bit, channel grouped.
Wave file (sent by audio engineer): 16bit 48.000KHz. Data Rate: 1528.21 kbits/s
Any help would be amazing!
Thanks,One possibility
You need to have your easy setup have a frame rate that exactly matches your sequence settings BEFORE you import the audio file. Doesn't seem to always cause a problem, but it can happen. -
How to compile and register a Java CFX tag with multiple class files?
All-
If this is the wrong forum for CFX questions, please let me
know.
I need to determine how to compile and register a Java CFX
tag that contains multiple class files. One class file implements
the CustomTag interface and the other class files implement various
supporting classes. All of the documentation that I have found
talks about using a single class file. I am assuming that a JAR
file will be involved, but I am not sure of the specifics.
Thanks in advance for your help.
-JoshYes, it will involve a jar. Use your java IDE (eclipse,
etcetera ..) to create a jar containing all of the classes. Check
your ide's documentation for how to create jar files. After you
have created the jar, place the jar in the CF class path so CF will
recognize it. For example the {cf_root}/WEB-INF/lib directory. CF
must be restarted before it will detect the new jar. After
restarting CF, register the CFX tag in the ColdFusion Administrator
using the name of the class that implements the CustomTag
interface.
Though it is worth noting you can also instantiate java
classes directly from ColdFusion (ie without using a CFX
tag). -
How do I get the block duration for wave file playback?
I'm using a LV example "Getting Started with sound and vibration express vi's (simulated). When I play back the examples the audio does not match the graphing updates as the file is played. That is, the sound continues to play after the graphs have finished reading the file. I can change the input box "block duration (s)" to achieve playback coordination between graph updates and audio. Is it possible to calculate this value from data included in the file? If not then if I have a vi that records sound to a wav file could the "block duration" be calculated there and passed to the playback vi? Just not sure what makes up the block duration. Thanks
Hi Mike,
The Block Duration that is configured from the Front Panel is a control that is used to determine how much of the sound file has the analysis performed. From the Block Diagram the Block Duration control is used to calculate the subset of the Get Waveform Subset.vi. Also notice the sound file is opened prior to entering the case structure, thus will begin first to execute due to dataflow. This may be easier to see using highlight execution. The sound VIs are not affected by the Block Duration at all as the entire sound file will be played. Take the data from your sound file and display it onto a chart or begin processing as in the Read Sound File to Chart.vi example for immediate updates Hopefully this helps!
Regards,
h_baker
National Instruments
Applications Engineer
Digital Multimeter Resources -
Stuttering during Playback of .wav files
I get stuttering during Playback of .wav files in my PC music library. I am using X-Fi Elite Pro. This doesn't do it all of the time, only occasionally. @97.22.92.33
Mathew Hennessy wrote:
How do I make it play a WAV playlist continuously?
Make sure that all the little boxes (in the column at the left) have a check-mark in them. -
An easy way to play wav files on a java program
Hey. I would like to include a wav file to my program, but so far have not succeeded (Is there a way to do this without using applets)
Please, post me a code that can be used without knowing too much about programming!Please, post me a code that can be used without knowing too much about programming! Hopefully you can read tutorials.
Read the tutorial on [url http://java.sun.com/docs/books/tutorial/]Sound.
Maybe you are looking for
-
How can I partition the remaining space on an external hard drive for use in Time Machine?
I backed up files from my old macbook to this external drive. I want to use all remaing space for time machine on my new Air that runs OSX Lion. Please help
-
Preflight settings work at the page level but not the document level?
Greetings all, Just wondering if anyone has run into this: I'm running Acrobat 10.1.3 on Lion and I've been struggling with getting my preflight settings to work. I can get a simple fixup (convert all to grayscale, for example) to work on a page or t
-
Excise duty - not reflected in Purchase Order
Hi Dears I have maintained tax code JMOP with tax code FV11 and selected country-plant-control code wise. I have also entered desired rate of excise duty here. Further J1ID was properly maintained for material-control code (Chapter id). But when I pr
-
I got shafted during the pre-order even though I ordered on time. I even got bamboozled at the Verizon store after waiting for four hours, and being third in line. At 8am we were all told that Apple sent them absolutely no iPhone 6 Pluses. Wonderful
-
Xws-security and fault messages
Hi, I have a problem with xws-security and fault messages. It seems that the security policy is not applied to fault messages. This results in a "javax.xml.rpc.soap.SOAPFaultException: Message does not conform to configured policy: No Security Header