Previous in Forum: How to Install Dual Operating System in Laptop   Next in Forum: Page Opens When Program For Any Files is Not Installed
Close
Close
Close
16 comments
Rate Comments: Nested
Associate

Join Date: Aug 2010
Posts: 25

How to Get a Single Frame/Image From a *.wav File?

08/27/2010 12:54 AM

In machine vision, we usually use black/white camera to grab images or videos. Now I want to know how can I get a single image from a *.wav file and save the single image as *.bmp format, and how many frames in a *wav file,and frame rate?

Do you know which software can do this?

Previously I use Matox 8.0( a kind of image processing software) do this my job related with machine vision. If I want to write code by myself, can you help to guide me to write code (using ActiveX control in Matrox 8.0) to accomplish above problem?

Other solution in coding is also welcomed.

Thank you.

Register to Reply
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Guru
Engineering Fields - Environmental Engineering - New Member APIX Pilot Plant Design Project - Member - New Member

Join Date: May 2007
Location: Anywhere Emperor Palpatine assigns me
Posts: 2774
Good Answers: 101
#1

Re: How to get a single frame/image from a *.wav file?

08/27/2010 1:51 AM
  1. Use a wav editor program such as Sonic Foundry SoundForge to open the wav file as a graph.
  2. Enlarge and zoom in on the section of the *.wav file that you want.
  3. Press the "print screen" button on your keyboard.
  4. Open MSPaint.
  5. Paste captured image on MSPaint.
  6. Edit image as you would with any other image file.
__________________
If only you knew the power of the Dark Side of the Force
Register to Reply Score 1 for Good Answer
Guru

Join Date: Oct 2009
Posts: 1460
Good Answers: 30
#2

Re: How to get a single frame/image from a *.wav file?

08/27/2010 5:58 AM

I don't think it is possible to do what you are asking. The .wav file format is intended primarily for audio waveforms, but can also be used for higher frequencies, and so for oscilloscope traces. However, it is not intended for image frames. You can use a .wav file as an audio input source for a video file format such as .avi, but the standeard .wav file itself is not the video source and you cannot grab frames from it. I suspect that your camera actually produces .avi; any video editing program should be able to extract a frame from that.

Register to Reply Score 1 for Good Answer
Associate

Join Date: Aug 2010
Posts: 25
#3

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 7:35 AM

Thanks above two guys.

In machine vision normally a video has a format like 30frames/second, with resolution 640 x 480 or something. Does someone have coding experience in this topic?

Thank you.

Register to Reply
Guru
Engineering Fields - Optical Engineering - Member Engineering Fields - Engineering Physics - Member Engineering Fields - Systems Engineering - Member

Join Date: Apr 2010
Location: Trantor
Posts: 5363
Good Answers: 647
#4

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 7:53 AM

If you can play the .wav file using Windows Media Player (like for playing a .wmv file) you could try pausing the video at the point you want to save, then hit the 'Control' + 'Print Screen' buttons together. This copies the entire screen image to the clip board. Then you can open Windows Paint and hit the Copy button in the Edit menu. This places the copy of the entire screen image into Windows Paint. From there you can use the editing tools on the image to get what you want. The default save option for Paint is a .bmp bitmap file.

__________________
Whiskey, women -- and astrophysics. Because sometimes a problem can't be solved with just whiskey and women.
Register to Reply Score 1 for Good Answer
Guru
Engineering Fields - Electrical Engineering - New Member United States - Member - New Member

Join Date: Apr 2007
Location: Wichita, Kansas USA
Posts: 653
Good Answers: 30
#5
In reply to #4

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 8:06 AM

Am I the one missing something here? I thought .wav files were audio - EXCLUSIVELY; how can you extract an "image" frame from an audio file? Perhaps there are .wav files with integrated video that I have not heard of?

Tom D.

Register to Reply Score 1 for Good Answer
Guru
Hobbies - Musician - Engineering Fields - Chemical Engineering - New Member Engineering Fields - Control Engineering - New Member Engineering Fields - Instrumentation Engineering - New Member

Join Date: Jan 2007
Location: Moses Lake, WA, USA, Thulcandra - The Silent Planet (C.S. Lewis)
Posts: 4216
Good Answers: 194
#7
In reply to #5

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 9:19 AM

No, you're not!. It seems very odd (or stupid) that, if it IS a proprietary video file, the machine vision manufacturers would choose the ubiquitous .wav as the extension.

Mike H.

__________________
"Reason is not automatic. Those who deny it cannot be conquered by it. Do not count on them. Leave them alone." - Ayn Rand
Register to Reply Score 1 for Good Answer
Associate

Join Date: Aug 2010
Posts: 25
#8
In reply to #5

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 9:26 AM

Hi,tdesmit,

In my practice I used a *.avi file as :

frame rate: 20 f/s;

Width=640;

height=480;

data size=8 bit;

uncompressed.

If someone need a sample file and want to write code in this topic, just send me a mail to me.

Register to Reply
Guru
Engineering Fields - Electrical Engineering - New Member United States - Member - New Member

Join Date: Apr 2007
Location: Wichita, Kansas USA
Posts: 653
Good Answers: 30
#9
In reply to #8

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 9:40 AM

OK, grabbing an image frame from an AVI file I can understand, grabbing an image frame from a WAV had me scratching my head :)

Tom

Register to Reply
Associate

Join Date: Aug 2010
Posts: 25
#10
In reply to #9

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 10:12 AM

Oh, maybe I had made a misunderstand.

I just want to get an image from a *wav or *.avi file.

Register to Reply
Associate

Join Date: Aug 2010
Posts: 25
#6
In reply to #4

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 9:17 AM

Thank you,Usbport

Using PrintScreen from Windows will cause the image distortion. That images are not good for image processing in machine vision which requires us to get real dimension from pixels.

Register to Reply
Guru

Join Date: Sep 2007
Location: Defreestville, NY
Posts: 1072
Good Answers: 87
#11

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 11:49 AM

Get VLC Media Player (free). Open your .avi or whatever file with it and when you get to the frame you want click Video>Snapshot. It will save the frame in whatever format you like.

Unlike PrntScrn there is no video distortion or cropping needed.

__________________
Charlie don't surf.
Register to Reply Score 1 for Good Answer
Associate

Join Date: Aug 2010
Posts: 25
#12
In reply to #11

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 9:23 PM

Thank you, Stevem.

I have tried VLC Media Player. It is great.

Can someone show me how to coding in this topic, in VB2005, or C#2005 or something else?

Register to Reply
Anonymous Poster
#13
In reply to #12

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 11:10 PM

If I understand you correctly you are looking to do this job of extracting a single frame from a video through software. If the video is a .avi file you can use OpenCV to do this job. You will need to install OpenCV - but once you do that it is quite straightforward. Of course, as you are probably aware, not all .avi files are alike and you will probably need to convert some of them before they can be 'read' by OpenCV.

Register to Reply Score 1 for Good Answer
Power-User
Hobbies - CNC - New Member

Join Date: Feb 2010
Location: Vallejo, CA
Posts: 127
Good Answers: 8
#14

Re: How to Get a Single Frame/Image From a *.wav File?

08/27/2010 11:34 PM

Another option for a free video/image editor is Utexas Image Tool: http://ddsdx.uthscsa.edu/dig/itdesc.html It's surprisingly versatile, and pretty well documented.

Register to Reply Score 1 for Good Answer
Associate

Join Date: Aug 2010
Posts: 25
#16
In reply to #14

Re: How to Get a Single Frame/Image From a *.wav File?

08/28/2010 1:16 AM

Thanks above 2.

It is good idea to use OpenCV, and I will try it.

ImageTool is great software which provide the basic image processing function.

Register to Reply
Active Contributor

Join Date: Feb 2009
Posts: 17
Good Answers: 1
#15

Re: How to Get a Single Frame/Image From a *.wav File?

08/28/2010 12:57 AM

Great discussion.

Register to Reply
Register to Reply 16 comments

"Almost" Good Answers:

Check out these comments that don't yet have enough votes to be "official" good answers and, if you agree with them, vote them!
Copy to Clipboard

Users who posted comments:

Anonymous Poster (1); drbobwoolery (1); DVader1000 (1); Mikerho (1); phph001 (1); snowman910 (1); stevem (1); tdesmit (2); Usbport (1); yuzaihuan (6)

Previous in Forum: How to Install Dual Operating System in Laptop   Next in Forum: Page Opens When Program For Any Files is Not Installed

Advertisement