Pocket PC Thoughts - Daily News, Views, Rants and Raves

Check out the hottest Windows Mobile devices at our Expansys store!





Go Back   Thoughts Media Forums > WINDOWS PHONE THOUGHTS > Windows Phone Software

Reply
 
LinkBack (13) Thread Tools Display Modes
  8 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 06-24-2005, 01:04 PM
5000+ Posts? I Should OWN This Site!
Join Date: Jun 2007
Posts: 5,037
Default AT LAST: Extracting embedded sound (WAV) files from Pocket Notes (PWI) files!

ActiveSync has always been unable to extract embedded sound files from Notes (.PWI) files, causing a lot of problems to people using this way to create notes with embedded voice notes - the embedded voice notes couldn't be played off your dekstop computer. Also, up to now, there has been a complete lack of an app doing this.

I've published the algorithm to extract these files from PWI files a long time ago (see for example this and this). So far, however, I hadn't the time to actually code, test with various JVM's (including Pocket PC JVM's) and document an actual utility that makes this possible.

Now that I had some free hours today, the waiting is over

The source code is pretty straightforward:

Code:
import java.io.*;

class PWIEmbeddedWAVExport
{
public static void main(String[] s) throws Exception
{
	FileInputStream fis = new FileInputStream (s[0]);
	File f = new File (s[0]);
	int fileSize = (int)f.length();
	byte[] barr = new byte[fileSize];
	byte[] barr2 = new byte[fileSize/2];
	int readCount = fis.read(barr);
	for (int i=0; i<fileSize/2; i++)
	  barr2[i]=barr[i*2];
	String str = new String(barr2);
	java.util.Vector indeces = new java.util.Vector();
	int lastIndexFound = 0; 
	while ((lastIndexFound = str.indexOf("VoiceNote.wav", lastIndexFound+1)) != -1)
			indeces.addElement(new Integer(lastIndexFound*2));
	// now, we have the exact position of all VoiceNote.wav's in the file; 
	// we can go on for the actual extraction
	int sumSize = 0;
	for (int i=0; i<indeces.size(); i++)
	{
		int embFileStartsAt = ((Integer)indeces.elementAt(i)).intValue()+ "VoiceNote.wav".length()*2-2 + 4146 + 4;
		int embFileEndsAt = readCount;
		if (i<indeces.size()-1) embFileEndsAt = ((Integer)indeces.elementAt(i+1)).intValue() - 528;
		FileOutputStream fos = new FileOutputStream (s[0].substring(0, s[0].length()-4)+(indeces.size()-i)+".wav"); 
		// indeces.size()-i is needed because of the LIFO order in the file
		fos.write(barr, embFileStartsAt, embFileEndsAt-embFileStartsAt);
		fos.flush();
		fos.close();
	}
	fis.close();
 } // main
}// class
Feel free to compile (preferably with JDK1.1 if you need 100% compliance with all of the PPC JVM's - please note that I deliberately made it JDK1.1-compliant for the best compliance with current PPC JVM's) and JAR it. To make your life easier, you can also download it from here.

On the desktop, put it in the classpath and issue the

java -jar PWIEmbeddedWAVExport.jar <PWI name>

command. The extracted sound files will be created in the current directory.

If you plan to do the extraction on the PDA so that you don't need to have access to any desktop computer, you can use any of the following four JVM's (others may also work): NetFront 3.1+, CrEme, Jeode, J9 PJava. Please read this thread for more information on getting them if you don't have any of them (not even the Java-enabled Netfront - perhaps this is the best solution because you may already have it on your Pocket PC, which makes it unnecessary to install another JVM.

To run the converter on the PDA, make a directory in it with the name, say, \conv in there. Copy the JAR file and one of the following batch files (I've also listed their contents here).

NetFront jvlite (tested with NF 3.1):

"\Program Files\NetFront3\jvlite.exe" -classpath \conv\PWIEmbeddedWAVExport.jar PWIEmbeddedWAVExport %1

CrEme 3.x/4.x (tested with 3.26):

"\SD-MMCard\creme\bin\CrEme.exe" -Ob -classpath \conv\PWIEmbeddedWAVExport.jar PWIEmbeddedWAVExport %1

Jeode (tested with 1.7.3):

\SD-MMCard\jeode\evm.exe -Djeode.evm.console.local.keep=true -cp \conv\PWIEmbeddedWAVExport.jar PWIEmbeddedWAVExport %1

IBM J9 PJ (tested with 5.7.2):

"\SD-MMCard\IBM PPRO10\bin\J9.exe" "-jclpro10" -cp \conv\PWIEmbeddedWAVExport.jar PWIEmbeddedWAVExport %1

Please modify the path to the executable according to the directory your JVM/NetFront is installed to!

The next step is installing PPC Command Shell - please see my post on doing this here (second page, third post) - to provide a console to run batch files to avoid the need for editing link files with wired-in filenames.

After installing it, fire up the console and go to \conv. Assuming you've already copied here the .BAT batch file(s) you want to invoke your JVM('s) with, PWIEmbeddedWAVExport.jar and the source PWI file(s), you can start working right away by issuing the <batchname> \conv\<PWI name> command. (Note that you need to supply the full directory path, here, \conv to the JVM so that it finds the input file.) The embedded WAV files will be created in the same directory.

I may rewrite/repackage this app using the CF framework some day (but not in the very near future!).
__________________
Microsoft MVP - Mobile Devices. You may want to check out my Smartphone &amp; Pocket PC Magazine Expert Blog.
 
Reply With Quote
  1 links from elsewhere to this Post. Click to view. #2 (permalink)  
Old 07-10-2005, 04:02 PM
5000+ Posts? I Should OWN This Site!
Join Date: Jun 2007
Posts: 5,037
Default Re: AT LAST: Extracting embedded sound (WAV) files from Pocket Notes (PWI) files!

Quote:
Originally Posted by Menneisyys
I may rewrite/repackage this app using the CF framework some day (but not in the very near future!).
Yes! It's here!

The Pocket PC version can be found here, while the PC version can be found here. Both require the CF framework, which is installed by default on all WM2003+ devices.

Tested on both an iPAQ 2210 and a Pocket Loox 720 (and, of course, the PC version on the desktop); works flawlessly.

Using on the Pocket PC:

1, download the ZIP file

2, extract the CAB file meant for your device. For example, all WM2003+ users should extract PWI_Embedded_Sound_Extractor_ARMV4.CAB. Transfer it to your PDA.

3, start File Explorer on your PDA and click the CAB file. Alternatively, you can use CabInstl or other tools like FileDialogChanger to install it on a storage card.

4, start the application (it doesn't have any fancy icon - just look for the name PWISoundExtractor). You'll be presented the following screen:




5, As instructed, click ‘Convert!’ and, on the next screen, just click on a PWI file that contains embedded sound files. The app will extract the files and tells you how many of them there were and into what directory it extracted them.

The PC version is similar but it lacks error detection (which isn’t a problem if you don’t pass it files that don’t have embedded sound files etc) and has a slightly different GUI (I didn’t have the time to synchronize the two GUI’s.) It works the same way: it puts the extracted files into the same directory as the input file.
__________________
Microsoft MVP - Mobile Devices. You may want to check out my Smartphone &amp; Pocket PC Magazine Expert Blog.
 
Reply With Quote
  #3 (permalink)  
Old 07-10-2005, 06:50 PM
Swami
Sven's Avatar
Join Date: Jun 2007
Posts: 4,788

Cool. Checked it out and works as advertised. Tried both the PPC and PC version. To bad you didn't do this 4-5 years ago. I remember an empasioned plea from a new father that had recorded his baby's first moments, and couldn't get the darn wav out of the note. It was back in the early days of the Jornada, and I don't think we ever figured out how short of playing it out the headset jack and recording it with something else.

Great job, man.

P.S. You need an icon
__________________
Sometimes you are the anteater, sometimes you are the ant.
 
Reply With Quote
  #4 (permalink)  
Old 07-10-2005, 07:00 PM
5000+ Posts? I Should OWN This Site!
Join Date: Jun 2007
Posts: 5,037

BTW, I've also uploaded the sources of the PPC version (the PC version is a bit older and has no error handling, so, I've chosen to make the PPC sources available) at http://winmobiletech.com/062005PWIEm...rt/PPC/src.rar .

Feel free to experiment with it
__________________
Microsoft MVP - Mobile Devices. You may want to check out my Smartphone &amp; Pocket PC Magazine Expert Blog.
 
Reply With Quote
  #5 (permalink)  
Old 07-10-2005, 07:01 PM
5000+ Posts? I Should OWN This Site!
Join Date: Jun 2007
Posts: 5,037

Quote:
Originally Posted by Sven
Cool. Checked it out and works as advertised. Tried both the PPC and PC version. [...]

Great job, man.

P.S. You need an icon
Thanks
__________________
Microsoft MVP - Mobile Devices. You may want to check out my Smartphone &amp; Pocket PC Magazine Expert Blog.
 
Reply With Quote
  #6 (permalink)  
Old 01-02-2006, 12:43 PM
Oracle
pocketpcadmirer's Avatar
Join Date: Jan 2006
Posts: 822
Send a message via Yahoo to pocketpcadmirer

Hey thanks Menneisyys..I've been looking for such an app for soooooooo long

Sunny
 
Reply With Quote
  #7 (permalink)  
Old 01-03-2006, 05:40 AM
5000+ Posts? I Should OWN This Site!
ctmagnus's Avatar
Join Date: Aug 2006
Posts: 5,769

If you use OneNote on your desktop, you can import Outlook's notes into it and any embedded sounds in Outlook's notes will come across as wma files in the My Documents\My Notebook folder on the desktop end.
__________________
iPhone 3GS! ☠☠☠ Treo Pro!
 
Reply With Quote
  #8 (permalink)  
Old 01-05-2006, 11:52 AM
Pupil
Join Date: Apr 2004
Posts: 33
Send a message via ICQ to Johnathan Send a message via MSN to Johnathan

thanks Menneisyys.. :wink:
__________________
I always believe that after every storm eventually a rainbow appears!
 
Reply With Quote
  #9 (permalink)  
Old 07-14-2006, 05:32 PM
Neophyte
Join Date: Jul 2006
Posts: 2
Default Can you translate this for a novice?

I recorded some audio using the notes feature on my Dell Axim x50. I copied the file to my PC and want to share it via e-mail. It is a .wpi file and I can't figure out how to play it on my pc.

Your post sounds like it will do exactly what I want, but I am not savvy enough to know how to use your information. I downloaded the PWIembeddedWAVExport.run file to my PDA, but when I try to open it it says there is no application associated with it and to run the application first. What application?

My second question is to avoid this in the future, how do I save audio notes as a .wav instead of a .pwi file type?

Thanks so much. What I want to share is audio of my 2 year old singing, so I can't exactly re-create it and I'd liek to share with out of town family. Thanks for your help.
 
Reply With Quote
  #10 (permalink)  
Old 07-14-2006, 05:38 PM
5000+ Posts? I Should OWN This Site!
Join Date: Jun 2007
Posts: 5,037
Default Re: Can you translate this for a novice?

Quote:
Originally Posted by lyfoster99
I recorded some audio using the notes feature on my Dell Axim x50. I copied the file to my PC and want to share it via e-mail. It is a .wpi file and I can't figure out how to play it on my pc.

Your post sounds like it will do exactly what I want, but I am not savvy enough to know how to use your information. I downloaded the PWIembeddedWAVExport.run file to my PDA, but when I try to open it it says there is no application associated with it and to run the application first. What application?

My second question is to avoid this in the future, how do I save audio notes as a .wav instead of a .pwi file type?

Thanks so much. What I want to share is audio of my 2 year old singing, so I can't exactly re-create it and I'd liek to share with out of town family. Thanks for your help.
Welcome to PPCT

1. Did you download the PC version ( http://winmobiletech.com/062005PWIEm...undExtract.exe )?

2. to record straight into WAV files, make sure you allow for displaying the Recording toolbar in Notes. That is,

on pre-WM5 OS'es, click the casette icon next to Tools
on WM5, go to Menu and click View Recording Toolbar

Make sur eyou do this in the List view.

Then, you'll be able to record into individual WAV files.
__________________
Microsoft MVP - Mobile Devices. You may want to check out my Smartphone &amp; Pocket PC Magazine Expert Blog.
 
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


LinkBacks (?)
LinkBack to this Thread: http://forums.thoughtsmedia.com/f398/last-extracting-embedded-sound-wav-files-pocket-notes-pwi-files-71943.html
Posted By For Type Date
Windows Mobile 5 Das nie endende Chaos! This thread Refback 11-14-2009 02:41 AM
Windows Mobile 6 Das nie endende Chaos! This thread Refback 11-13-2009 05:42 PM
Problemlöser Das nie endende Chaos! This thread Refback 10-27-2009 08:10 AM
PWI Dateien von Windows Mobile Das nie endende Chaos! This thread Pingback 10-23-2009 11:01 AM
Forum Ubuntu-fr.org / [resolu] ouvrir un fichier PWI This thread Refback 06-11-2009 12:52 PM
Java Forum @ javaCore.de :: Thema anzeigen - pwi notizen anzeigen This thread Refback 06-03-2009 07:17 PM
How extract sound waves from pwi - PPCGeeks Post #0 Refback 04-21-2009 04:11 PM
Ph?n m?m dŕnh cho Pocket PC (c?p nh?t m?i)-Ph?n 2 | Phan mem danh cho Pocket PC (cap nhat moi)-Phan 2 - Page 90 - .:: GSMVN FORUM ::. This thread Refback 03-18-2009 10:24 AM
Ph?n m?m dŕnh cho Pocket PC (c?p nh?t m?i)-Ph?n 2 | Phan mem danh cho Pocket PC (cap nhat moi)-Phan 2 - Page 90 - .:: GSMVN FORUM ::. This thread Refback 02-19-2009 06:27 AM
Developer page - Werner Ruotsalainen - Softpedia This thread Refback 12-03-2008 08:10 PM
WM How To: PWI Conversion Part 2 : Pwi to Wav | Palm Discovery.com This thread Refback 11-21-2008 05:40 AM
PWI Converter In PDA4x We Trust _ www.pda4x.com This thread Refback 11-12-2008 02:59 AM
PWI Converter In PDA4x We Trust _ www.pda4x.com This thread Refback 10-30-2008 12:57 AM


All times are GMT +1. The time now is 10:34 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 RC7