JDBC & WAVE FILES

Hi
I want to save wave file at database and retrive it
I using sql server 2000 Database
public WAVEFILE()
try
String host = "SERVER";
String username = "dalia";
String password = "dalia";
String database = "child";
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
String url2 = "jdbc:microsoft:sqlserver://" + host + ":1433";
Connection con = DriverManager.getConnection("jdbc:microsoft:sqlserver://" + host +
":1433;DatabaseName=" + database,username, password);
//to save wav file
File file = new File("D:\\test.wav");
int fileLength = (int)file.length();
if(fileLength > 0)
FileInputStream fis = new FileInputStream(file);
String query = " INSERT INTO Wave VALUES(? ) ";
PreparedStatement pstmt = con.prepareStatement(query);
pstmt.setBinaryStream(1, fis, fileLength);
pstmt.executeUpdate();
//to retrive wav file
String query = " Select Voice From WAVE WHERE ID=1";
PreparedStatement pstmt = con.prepareStatement(query);
ResultSet RS = pstmt.executeQuery();
while(RS.next())
InputStream fis = RS.getBinaryStream(1);
byte[] wavFileBytes = new byte[fis.available()];
fis.read(wavFileBytes);
ByteArrayInputStream bais = new ByteArrayInputStream(wavFileBytes);
AudioInputStream ais = AudioSystem.getAudioInputStream(bais);
//AudioSystem.write(ais,AudioFileFormat.Type.WAVE,new File("D://tt.wav"));
catch(Exception ex)
ex.printStackTrace();
This code work when i set the voice column's data type (at SQL SERVER 2000) is Binary(max legnth is 8000),
but when i use image data type(max length is 2,147,483,647) the EOFException thrown.
I need help as i can't use binary type as its length is not enough for my wave files.

I am sorry for late to reply,
The EOFException is
java.io.EOFException
     at java.io.DataInputStream.readInt(DataInputStream.java:397)
     at com.sun.media.sound.WaveFileReader.getAudioFileFormat(WaveFileReader.java:96)
     at com.sun.media.sound.WaveFileReader.getAudioInputStream(WaveFileReader.java:237)
     at javax.sound.sampled.AudioSystem.getAudioInputStream(AudioSystem.java:680)
     at tests.WAVE.WAVEFILE.<init>(WAVEFILE.java:55)
     at tests.WAVE.WAVEFILE.main(WAVEFILE.java:90)
And i don't know how to use BLOB i try
Blob b = rs.getBlob(1);
I got this Exception
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Unsupported data conversion.
     at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
     at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
     at com.microsoft.jdbc.base.BaseData.unsupportedConversion(Unknown Source)
     at com.microsoft.jdbc.base.BaseData.getBlob(Unknown Source)
     at com.microsoft.jdbc.base.BaseResultSet.getBlob(Unknown Source)
     at tests.WAVE.WAVEFILE.<init>(WAVEFILE.java:49)
     at tests.WAVE.WAVEFILE.main(WAVEFILE.java:90)
Has anyone stored wav files in a database, retrieved and played them? Maybe URLs are used for this?
Thanks for help

Similar Messages

  • How do I change the key of a wav file?

    I'm using Apple Loops Utility and the wav file plays the correct key & tempo there. But when I save it, and open it up in LE or add it into the arrangement, it's playing the original key? The only thing that is correct is the tempo. Can you change the key and save the change using Apple Loops Utility?

    I'm confused. Are you saying that in Apple Loops Utility the wav plays in the key and tempo of that wave, but when you add the same wav to LE it plays in a different key? You said in LE it plays in the "original" key. Seems like that is what you would expect. I would think it would play in the "original" key in both ALU and LE.

  • Placing 24/192 WAV files on iTunes for playback through Wadia 170 iTranspor

    I record live music on a Sound Devices 722 digital audio recorder at 24/192 as WAV files. I can import the 24/192 WAV file into iTunes on a Mac and the bit rate is displayed as 9216 kps. This makes sense since 24x192=9216. When I click on the song in iTunes it plays back at the correct tempo.
    I bought a Wadia 170 iTransport since it says it will output bit perfect digital files. I'd love to hear my recordings this way over my sound system. I understand that this would chew up drive space real fast on an iPod. However . . .
    I can't get my iPod to accept the 9216 kps song files. I went to set iTunes / Preferences / Advanced / Importing to WAV but the options for sample rate only go up to 48.0 kps and the bit rate up to 16-bit.
    Any thoughts or suggestions on how to overcome this will be appreciated.

    Hi,
    I'm from germany so no 'best buy' but I think I will lock around sleeve/bag for a different product with same measures. Any tip?
    The clear plastic case is not what I want. I would like to use the player without such protections. I just want a sleeve to protect the player while its in my jacket/pants.
    Btw, i have bought this version: Creative Zen (maybe european version?). I also doesn't seem to have your mentioned sleeve. I also couldn't find it on the website.
    Anyway, thank you,
    Chris

  • Broadcast Wav files from PT to Logic not moving to original record position

    Okay, my system needs upgrading but I'm stable (at least I think I am til now!) I have a TV network sending me broadcast wav files from PT. They shoot their video on a 24 hour clock. I'm to be editing and mixing (in Logic) their audio tracks from PT and send them back as broadcast wav files for them to sync back to their video. After years and years of recording and producing music, this TV world is a first for me. 2 issues at hand that are causing trouble.
    NUMBER 1: The wav files will not snap to original record position. I keep getting an error message about "out of range" and of all craziness with a negative SMPTE number. ??? The prompt suggests an offset error. But there isn't I can find. Start time is set to 0:0:0.0.0 here and at the TV studio. They film at 29.97d. That matches as well. Sample Rate is correct at 48k 24bit. I've uncovered every thing I can think of. I did have to set the tempo down to 5 BPM in order to see a full 24 hours in SMPTE.
    NUMBER 2: I can't figure out how to see the timestamp start time of the audio files in the audio window. I have every option turned on in the VIEW option, I can see length, but I see nothing about start time of original record time. Am I missing something simple here? Seems like a very standard option that should be easily accessible. It would allow me to prepare the location on the time line.
    Overall, I'm hoping I can do all the above with my current rig but realize that the clock is ticking toward a whole new system with Logic 9.
    Help please. Don't want to lose this client.

    Sure do appreciate everyone's willingness to help. Setting SMPTE start to 24:00:00.0.0 didn't work either. I confirmed with the studio manager at the TV station also that they run a 24hour clock with 0 being midnight.
    I'm really hoping that the error is on their end.
    *It would help me if anyone knew how to VIEW the Timestamp info attached to the wav files. That would at least give me an approximate idea of where they should be.*
    I'm supposed to be editing and mixing the voice dialog from numerous different scene takes that were shot throughout a day of filming. It's critical that I can see all these different takes that were captured over hours of open recording. Some of the files are almost 4 hours long. It's a big project and I'm sure hoping I can stay inside Logic to get it all done with excellence.

  • Wav files on external drive will not work in Apple Loops

    When I import wav files (from Nu Jazz Funk library) by dropping on the AL browser from an external drive, Apple Loops insists on copying them to my system drive (no option to make use current location). If I manually make an alias, the files show up, but play at the wrong tempo. I even tried letting AL make the copy, then moving that to an external drive & making an alias of that. No go. BTW, aif files work fine.

    Yeah, that's because Apple Loops are .AIF files, not .WAV.

  • Tempo problems with imported wav files

    Hey everyone, sorry if there's a quick fix for this in the forums that I couldn't find, but I've been having some tempo problems with imported .wav files.
    Long story short, my system couldn't handle playing all the tracks for a song while recording drums, so I bounced out an mp3 of the song and put it in a new Logic file so my drummer could just play along to that as I recorded him. Unfortunately, the original song is at 167 bpm, but I forgot to change the bpm in the new Logic file with the .mp3 file of the song to 167 bpm, so it was left at the default 120 bpm.
    So, the drums were recorded at the correct 167 bpm, but Logic thinks that those new drum .wav files should be played at 120 bpm, so when I import my drum tracks back into the original file, they do not play correctly at all.
    I could get record it all again, but I wanted to check if there was a way I could salvage what I already have, since my drummer lives about an hour away right now and can't just come over whenever he wants.
    Thanks for the help! I really appreciate it.

    Hi,
    First, do not use MP3 in Logic, the sound quality is less than AIFF, WAV or CAF, and Logic has to decode it for playback, making it a heavier burden on the CPU than an uncoded audiofile, such as AIFF, WAV or CAF.
    Secondly, audio files are independent of Logic's tempo. If you bounce down an audio file in any format (other than Apple Loop), it will play back at the same speed, +regardless of Logics' tempo setting+, either at recording or playback. Logic doesn't 'think' anything. The BPM is only important to MIDI tracks, or to the spacing between audio files. The audio files themselves *are not affected* by the tempo setting. If you import an audio file of tempo 167 into a 120 BPM project, the file will still play at 167, only Logic will indicate the wrong bar positions.
    regards, Erik.

  • Wav file from remix stem pack has no volume - Logic Pro 9

    I recently downloaded a remix stem pack and can't get the vocal wav file to play. It show's a wave form, but no volume. If I load a sample wav file, a drum hit for example, it will play no problem. Anyone have any idea's? It's not the wav file as it plays in itunes, and also plays in my friends logic pro.
    Thanks

    The hierarchy is [LOGIC FILE NAME]>LgDoc>(files ... Displaystate, DocumentData, Windowimage.jpg)
    Like this:
    You need to recreate the folder structure in order to be able to open the file.  (look at the path bar at the bottom of the picture.)
    Do not disassociate the displaystate from the documentData files.  They should be together.  The windowimage file is optional and will be recreated when the file is saved again.
    Hope this helps!

  • How can I open a WAV file in LabVIEW 7?

    I need to make a program that opens a WAV file and converts it into amplitudes values and saves the in a .txt file. But how can I make LabVIEW 7 open up a WAV file? It's probably easy, but I didn't come up with anything up to now!
    Thanks in advance!

    try this
    regards
    timo
    Attachments:
    wav2txt.vi ‏17 KB

  • Mixing external wave file into video

    I've recorded a video including sound of a mandolin being played.  At the same time I recorded the sound with my external recorder which resulted in a wave file of better quality that the sound from the camera.  I would like to import the video and the externally recorded wave file into a project, line up the external wave file with the sound recorded by the video camera and then delete the sound recorded with the video camera so I end up with a video that has the sound from the external recording system.  Any recommendations on a good approach to accomplishing this task?

    There's information here about how to use the new merged clips features in Premiere Pro CS5.5 to merge the audio from an external source with the video from the camera.

  • How do I get Logic to stop looking for a specific .wav file?

    I recently imported a project I started in GarageBand into Logic Pro.  Once in Logic, I edited and added to the project then saved it as a Logic project file.  I deleted the original project from GarageBand.  Now, when I open the Logic file, Logic is still looking for .wav files that were used in the original GarageBand file.  None of these files are actually needed in my project.  Is there a way that I can get Logic to stop looking for these .wav files?
    Thanks for any help!

    Do a cleanup.
    http://documentation.apple.com/en/logicpro/usermanual/index.html#chapter=7%26sec tion=9%26tasks=true

  • 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

  • ITUnes converted all the wav files on my computer to m4a. How do I recover them?

    iTunes took it upon itself to convert all of the .wav music files on my computer to .m4a, a much lower-quality format. How can I get the .wav files back?

    Hi someonefromminnesota,
    Depending on how the tracks were imported/converted, the original .wav files may still be located in their original location, and an .m4a copy may have been added to the iTunes Library. You may find the following article helpful:
    iTunes 11 for Windows: Import music and video already on your computer
    http://support.apple.com/kb/PH12493
    iTunes: How to convert a song to a different file format
    http://support.apple.com/kb/HT1550
    Regards,
    - Brenden

  • How can I convert an AiFF File to a Wav file?

    How can I convert an AiFF File to a Wav file?
    Any free software out there? or can iTunes or Quicktime perform this task?
    -D

    or can iTunes or Quicktime perform this task?
    Yes to both.
    In Quicktime Export -> Export Sound to Wave
    In iTunes, check your preferences for General>Import and then right click on the file to convert to WAV
    Also STP can do that.
    Double click the file to open it in the File Editor and Save as, then select Wave as the filetype.

  • How do I convert an audio link into a wav file?

    how do I convert an audio link into a wav file with my Imac?
    A PC user showed me to right click an audio link where it asked if it wanted to save the link as a Wav file?
    I saw this done in front of me. How do I do it with my Mac ?

    This is how to do it in itunes http://support.apple.com/kb/ht1550
    If I view the song in finder, all that i have to do is press command-i and it opens a window. In the section where you view the name and extension I took off the extension (.mp3 in my case) and replaced it with .wav

  • How can I convert an array into a .wav file?

    I have an array of points that I need converted and written into a .wav file. Any help?

    Indeed there is!
    Look at the attached vi....that's about all there is to it!
    Good Luck..
    Eric
    Eric P. Nichols
    P.O. Box 56235
    North Pole, AK 99705
    Attachments:
    ARRAY_TO_WAVE.vi ‏17 KB

Maybe you are looking for

  • How come my Ipod no longer plays videos?

    Hello...About a year ago I downloaded a Kelly Clarkson music video to my 5th generation ipod and it worked fine. I haven't watched it for a while but when I tried to play it today on my ipod nothing happened. (works fine on my itunes music library).

  • Application quits unexpectedly

    Hey everyone, I have a really annoying problem that I think is connected to Snow Leopard, but I'm sure a large part of it is my own stupidity. Back in May, I downloaded a copy of Dinertown Tycoon (I know-shutup) and I played it until I only had 2 min

  • SM Bus Controller Win 8.1 Driver Required

    Had a  240 Gig SSD installed on my new HP Pavilion Windows had to be reinstalled from scratch & I now need a SM Bus Controller Driver Tried loading the Intel drivers from the HP Driver site It  loaded the missing PCI Simple Communications Controller

  • Itunes 9 won't install on my Windows Vista (64 bit)

    I had Itunes 7, and my computer tried to update it to Itunes 9. While its downloading, it all of a sudden stops and says, "There is a problem with this windows installer package. A program required for this install to complete could not be run. Conta

  • Update vendor payment terms

    Hello I have a requirement to have the same values for vendor payment terms in purchasing view and accounting view. I found this topic which works only with transaction XK01 & XK02 Wich user-exit  for Creating Vendor I must use? How make it work with