Home PageFacebookRSS News Feed
PocketGPS
Web
SatNav,GPS,Navigation
Pocket GPS World - SatNavs | GPS | Speed Cameras: Forums

Pocket GPS World :: View topic - Spoken POI alerts for TomTom GO, Mobile, PocketPC and Palm
 Forum FAQForum FAQ   SearchSearch   UsergroupsUsergroups   ProfileProfile   Log in for private messagesLog in for private messages   Log inLog in 

Spoken POI alerts for TomTom GO, Mobile, PocketPC and Palm
Goto page Previous  1, 2, 3 ... 8, 9, 10 ... 71, 72, 73  Next
 
Post new topic   Reply to topic    Pocket GPS World Forum Index -> TomTom Portable Navigation Devices
View previous topic :: View next topic  
Author Message
lbendlin
Pocket GPS Staff
Pocket GPS Staff


Joined: 02/11/2002 22:41:59
Posts: 11878
Location: Massachusetts, USA

PostPosted: Sat Mar 05, 2005 4:54 pm    Post subject: Reply with quote

www.ghostwheel.de/viftool.zip
_________________
Lutz

Report Map Errors here:
TomTom/TeleAtlas NAVTEQ
Back to top
View user's profile Send private message Send e-mail
lbendlin
Pocket GPS Staff
Pocket GPS Staff


Joined: 02/11/2002 22:41:59
Posts: 11878
Location: Massachusetts, USA

PostPosted: Sat Mar 05, 2005 4:57 pm    Post subject: Reply with quote

CHEDS wrote:
sorry build number is 2852/041010


check your email and please report back.
_________________
Lutz

Report Map Errors here:
TomTom/TeleAtlas NAVTEQ
Back to top
View user's profile Send private message Send e-mail
CHEDS
Regular Visitor


Joined: Feb 25, 2005
Posts: 75

PostPosted: Sat Mar 05, 2005 6:35 pm    Post subject: Reply with quote

Lutz that is absolutely fantastic can you do that for all the alerts ?also I don't want to be too fusy but would it be possibe for you to use the old polite 2 sound

Thanks again Laughing
Back to top
View user's profile Send private message
lbendlin
Pocket GPS Staff
Pocket GPS Staff


Joined: 02/11/2002 22:41:59
Posts: 11878
Location: Massachusetts, USA

PostPosted: Sat Mar 05, 2005 7:58 pm    Post subject: Reply with quote

That is the old Polite2 sound - just using 2/3 of it otherwise it's getting way too long.

We're off to CeBIT now - so this will have to wait.
_________________
Lutz

Report Map Errors here:
TomTom/TeleAtlas NAVTEQ
Back to top
View user's profile Send private message Send e-mail
CHEDS
Regular Visitor


Joined: Feb 25, 2005
Posts: 75

PostPosted: Sun Mar 06, 2005 6:30 pm    Post subject: Reply with quote

My polite 2 seems to be more like a call button on an aircraft (Ithink !)
Back to top
View user's profile Send private message
Dixie68
Occasional Visitor


Joined: Jan 29, 2005
Posts: 38

PostPosted: Mon Mar 07, 2005 1:07 am    Post subject: Reply with quote

Ok I'm totally new to this and I'm reasonably sure that I'd totally mess it up if I tried to change the audible alerts Confused ... so, has anyone got a version that keeps the original sounds except for one that's been replaced by a voice saying "Speed Camera" or "Gatso"? (Preferably "Speed Camera" as "Gatso" confuses the hell out of my wife)!
I've managed to change the file for the one downloadable here but it replaces sounds I use a lot (such as the Cow sound for Burger Kings etc) so I changed it back.
Also, it doesn't change Jane's directions does it?
If some kind soul has the above could they put in a link to it for us less-than-technically minded people (probably just me and the wife)?

Cheers

Dixie
Back to top
View user's profile Send private message
feenix
Banned


Joined: Oct 26, 2004
Posts: 27

PostPosted: Tue Mar 08, 2005 12:14 pm    Post subject: Reply with quote

Hi,
First let me say thanks, all seems to work really well. the volume I'm sure is about the same as it always was, the difference is more in the range of the sound. IE if the warnings could start with some sort of electronically sounding beep it would be more noticable.
The other thing I would ask is that instead using the last sound for a 'credits' slot could we not have some sort of buzz, boing, beep, etc that could be used for any other POI we want to be notified of?
having read through all the instructions for installing on the TTG though I would suggest writting a full set of install instructions afresh. the current instructions are gettng to be a bit of a mish-mash as they are slightly changed and tweaked.
On the whole though, great job, GPS has never been so much fun. Smile
Feenix
Back to top
View user's profile Send private message
CHEDS
Regular Visitor


Joined: Feb 25, 2005
Posts: 75

PostPosted: Tue Mar 08, 2005 5:02 pm    Post subject: Reply with quote

Lutz

How did cebit go ?Just wondering if you have managed to do anymore on the alerts you was doing for me
My polite 2 sound seems different to the one you have, mine seems to be more like a call button on an aircraft (I think !)If that makes sense
Back to top
View user's profile Send private message
Jayuk
Occasional Visitor


Joined: Nov 23, 2004
Posts: 4

PostPosted: Wed Mar 09, 2005 6:50 pm    Post subject: Reply with quote

Great work on the voices folks...Thanks to all who have workerd on this Smile

Have to agree with the earlier comments though regarding the volume level, even with the new increased volume I am still finding them way to quiet....

With the radio on I am barely hearing the voiced alerts, so would it be at all possible to release a louder set?

Many thanks in advance.
Back to top
View user's profile Send private message
kieranrawley
Occasional Visitor


Joined: Mar 10, 2005
Posts: 1

PostPosted: Thu Mar 10, 2005 1:42 pm    Post subject: Reply with quote

I have just downloaded the new voice prompts for the cameras but I have a question that I am sure will have a simple answer but won't come to me. Do I have to assign the right sound to each and every camera location in the memory? That would surely take weeks to do and could result in masses of errors.

I am using v4.42 if that helps

Please help a technomuppet user out someone!!
Back to top
View user's profile Send private message
TomTomTim
Occasional Visitor


Joined: Feb 10, 2005
Posts: 25

PostPosted: Wed Mar 23, 2005 11:16 am    Post subject: Reply with quote

I noticed from Dave Burrows' excellent and comprehensive report on TT5 from CeBit that TomTom are still not including a feature to customise the POI warning sounds... Bit of a disappointment Sad

However, as a Palm user, I am looking forward to a free upgrade to 5 (maybe...) so I'm not really complaining Wink

I was wondering how the news from CeBit has affected the discussion that Lutz mentioned before CeBit - i.e. the one about potentially making the modified version of VIFTOOL (just my description - hope it's not hopelessly inaccurate) available so that we can all change our POIs just as we can change the voice commands? I am a bit loathed to continually ask for slight modifications to the DATA.CHK file but I can see that I might want to experiment with several before I find the best option.

I use my Navigator in the car and on my motorcycle - in the latter case I would want a different warning as I don't always ride with the unit visible and rely solely on audio warnings - with all that wind noise, too many words in a warning detract from the message. In the car, I can always see the unit but the additional voice information is sometimes useful, though not so much in built-up areas, where I would rather just hear 'polite 2'.... The list goes on (and on) but you get the idea.

Looking forward to hearing the latest on this issue
TTT
Back to top
View user's profile Send private message
lbendlin
Pocket GPS Staff
Pocket GPS Staff


Joined: 02/11/2002 22:41:59
Posts: 11878
Location: Massachusetts, USA

PostPosted: Thu Mar 24, 2005 5:39 pm    Post subject: Reply with quote

We promised to give you an answer after CeBIT. Well, here it is...

Due to bandwidth constraints (called "real life") we decided to put the code up for grabs. Feel free to create your own POI warning sounds, but please refrain from trying to sell them. This code is public domain

You need some knowledge of VB to understand the code . The current implementation uses Excel, but you can certainly find other ways, too.


Here's the code:
Code:

Sub data_chk_reload()
  Type CHKentry
    offset As Long
    sourceoffset As Long
    length As Long
    tag As Byte
    packtype As Byte
    blocks As Integer
    ogglength As Long
  End Type
  Dim g As Long
  Dim b As Byte
  Dim bt As Byte
  Dim Maxfiles
  Maxfiles = 30
  Dim entry() As CHKentry
 
  'this folder holds the original data.chk file
  folder = "C:\setup\iPAQ\Navigation\TomTom\Voices\"
  'identifier of the data.chk version. complete file name is identifier.data.chk
  fname = "2852"
 
  'the OGG files need to be in the subfolder specified by cell C1
  fnum = FreeFile
  Open folder & fname & ".data.chk" For Binary Access Read As #fnum
  flen = FileLen(folder & fname & ".data.chk")
  g = get_long
  Debug.Print fname; " Number of modules: "; g; " File size: "; flen
  If (g <> 102) And (g <> 120) And (g <> 123) And (g <> 136) Then
    a = MsgBox("Not a good DATA.CHK file. Please report your build version of the TomTom program to lutz@pocketgpsworld.com", vbOKCancel, "Error - wrong file version")
    Close
    Exit Sub
  End If
  'get offsets
  If g = 102 Then Maxfiles = 12
  ReDim entry(g + 1)
  For i = 1 To g + 1
    entry(i).offset = get_long
    entry(i).sourceoffset = entry(i).offset
    If i > 1 Then entry(i - 1).length = entry(i).offset - entry(i - 1).offset
  Next
  'confirm file size
  If entry(g + 1).offset = flen Then
    Debug.Print "File size confirmed"
  Else
    Debug.Print "File size mismatch!  Reported:" & Hex(entry(g + 1).offset) & " Actual:" & flen
  End If
 
  'calculating new offsets etc
  Debug.Print "Calculating new parameters"
  i = 2
  For f = g - Maxfiles To g
    If (Cells(i, 3) > vbNullString) And (f < g) Then 'new file
      Debug.Print "Verifying "; Cells(i, 3)
      flen = FileLen(folder & Cells(1, 3) & "\" & Cells(i, 3))
      entry(f).ogglength = flen
      pad = 0
      While flen Mod 4 <> 0
        flen = flen + 1
        pad = pad + 1
      Wend
      entry(f).blocks = (flen + 12) / 4
      entry(f).length = flen + 16
    End If
    i = i + 1
  Next
       
  'recalculate header
  Debug.Print "Recalculating header ";
  For i = g - Maxfiles To g + 1
    entry(i).offset = entry(i - 1).offset + entry(i - 1).length
  Next
  Debug.Print "- new File Size is "; entry(g + 1).offset
   
  'write output file
  Debug.Print "Writing CHK file "
  On Error Resume Next
  Kill folder & Cells(1, 3) & "\" & fname & "_new.data.chk"
  On Error GoTo 0
  fnum2 = FreeFile
  Open folder & Cells(1, 3) & "\" & fname & "_new.data.chk" For Binary Access Write As #fnum2
 
  'write header
  'number of segments
  put_long (g)
  'offsets
  For i = 1 To g + 1
    put_long (entry(i).offset)
  Next
  'non-voice files
  'position pointer
  Get #fnum, entry(1).offset, b
  h = entry(g - Maxfiles).offset - entry(1).offset
  For i = 1 To h
    Get #fnum, , b
    Put #fnum2, , b
    DoEvents
  Next
       
  'write sound files, either from source or from new OGG
  Debug.Print "Writing CHK file - Sounds"
  i = 2
  For f = g - Maxfiles To g
    If (Cells(i, 3) > vbNullString) And (f < g) Then 'read new file
      Debug.Print "Including "; Cells(i, 3); " for "; Cells(i, 1)
      'recreate header
      b = 1
      Put #fnum2, , b
      b = 0
      Put #fnum2, , b
      b = entry(f).blocks \ 256
      Put #fnum2, , b
      b = entry(f).blocks And 255
      Put #fnum2, , b
      put_long (1)
      put_long (8)
      put_long (entry(f).ogglength)
      fout = FreeFile
      Open folder & Cells(1, 3) & "\" & Cells(i, 3) For Binary Access Read As #fout
      For h = 1 To entry(f).ogglength
        Get #fout, , b
        Put #fnum2, , b
        DoEvents
      Next
      'padding
      b = 0
      flen = entry(f).ogglength
      While flen Mod 4 <> 0
        Put #fnum2, , b
        flen = flen + 1
      Wend
      Close (fout)
    Else 'read from source
      'position pointer
      Get #fnum, entry(f).sourceoffset, b
      For h = 1 To entry(f).length
        Get #fnum, , b
        Put #fnum2, , b
        DoEvents
      Next
    End If
    i = i + 1
  Next
  Close
  Beep
  Debug.Print "Done - real new file size is "; FileLen(folder & Cells(1, 3) & "\" & fname & "_new.data.chk")

   
End Sub

'required because of the little endian storage of long values
Function get_long() As Long
  Dim b As Byte
  l = 0
  For h = 1 To 4
    Get #fnum, , b
    l = l * 256 + b
  Next
  get_long = l
End Function
Sub put_long(ByVal l As Long)
  Dim b(4) As Byte
  For h = 1 To 4
    b(h) = l And 255
    l = l \ 256
  Next
  For h = 4 To 1 Step -1
    Put #fnum2, , b(h)
  Next
End Sub






And here's the sample Excel table

Code:

Name   Sampling   UKVoices
Beep 1   11025   Beep_1_gatso.wav22.ogg
Beep 2   11025   Beep_2_gatso_thirty.wav22.ogg
Beep 3   11025   Beep_3_gatso_forty.wav22.ogg
Beep 4   11025   Beep_4_gatso_fifty.wav22.ogg
Beep 5   11025   Beep_5_gatso_sixty.wav22.ogg
Bell 1   11025   Bell_1_mobile.wav22.ogg
Bell 2   11025   Bell_2_mobile_thirty.wav22.ogg
Bell 3   11025   Bell_3_mobile_forty.wav22.ogg
Boing   11025   Boing_mobile_fifty.wav22.ogg
Bugle   11025   Bugle_mobile_sixty.wav22.ogg
Cow   11025   Cow_mobile_seventy.wav22.ogg
Cuckoo   11025   Cuckoo_redlight.wav22.ogg
Polite 1   11025   Polite_1_specs.wav22.ogg
Polite 2   11025   Polite_2_temp.wav22.ogg
Polite 3   11025   Polite_3_Credits.wav22.ogg
Beep 1   16000   Beep_1_gatso.wav16.ogg
Beep 2   16000   Beep_2_gatso_thirty.wav16.ogg
Beep 3   16000   Beep_3_gatso_forty.wav16.ogg
Beep 4   16000   Beep_4_gatso_fifty.wav16.ogg
Beep 5   16000   Beep_5_gatso_sixty.wav16.ogg
Bell 1   16000   Bell_1_mobile.wav16.ogg
Bell 2   16000   Bell_2_mobile_thirty.wav16.ogg
Bell 3   16000   Bell_3_mobile_forty.wav16.ogg
Boing   16000   Boing_mobile_fifty.wav16.ogg
Bugle   16000   Bugle_mobile_sixty.wav16.ogg
Cow   16000   Cow_mobile_seventy.wav16.ogg
Cuckoo   16000   Cuckoo_redlight.wav16.ogg
Polite 1   16000   Polite_1_specs.wav16.ogg
Polite 2   16000   Polite_2_temp.wav16.ogg
Polite 3   16000   Polite_3_Credits.wav16.ogg
Shutter   11025   


   GO needs 22050 Hz in first bank
   Nokia needs second bank at 16000 Hz



Good luck.
_________________
Lutz

Report Map Errors here:
TomTom/TeleAtlas NAVTEQ
Back to top
View user's profile Send private message Send e-mail
Stormin
Occasional Visitor


Joined: Dec 31, 2004
Posts: 29

PostPosted: Thu Mar 31, 2005 9:48 pm    Post subject: Reply with quote

Der Thicko alert, right ive a ttgo with 4.42, bought a new 256 card. managed to load all camera's, which work no prob. down loaded voice warnings as per your instructions, struggling with this biz save 2582data etc to computer. Its in my documents.Using windows 98.
Ive tried dragging the voice file on to uk map folder like i did for camera's but it doesn't work. Is my computer too old or is that me. Or am i better sticking with the normal noise's than messing with something i obviously have no idea about Sad
Back to top
View user's profile Send private message
Oldboy
Pocket GPS Moderator
Pocket GPS Moderator


Joined: Dec 08, 2004
Posts: 10642
Location: Suffolk, UK

PostPosted: Fri Apr 01, 2005 6:36 am    Post subject: Reply with quote

Stormin wrote:
Der Thicko alert, right ive a ttgo with 4.42, bought a new 256 card. managed to load all camera's, which work no prob. down loaded voice warnings as per your instructions, struggling with this biz save 2582data etc to computer. Its in my documents.Using windows 98.
Ive tried dragging the voice file on to uk map folder like i did for camera's but it doesn't work. Is my computer too old or is that me. Or am i better sticking with the normal noise's than messing with something i obviously have no idea about Sad

The file 2582data.chk goes into the root folder not in the map folder. Then just rename original to data._hk and then the new one Data.chk.
_________________
Richard

TT 910 V7.903: Europe Map v1045
TT Via 135 App 12.075: Europe Map v1120
Back to top
View user's profile Send private message Visit poster's website
TomTomTim
Occasional Visitor


Joined: Feb 10, 2005
Posts: 25

PostPosted: Sun Apr 03, 2005 4:28 pm    Post subject: Quick and dirty “make you own POI warning sound files” Reply with quote

Quick and dirty “make you own POI warning sound files”.

This posting records what I did with the code that Lutz Bendlin kindly posted on Thu Mar 24, 2005 4:39 pm about three posts before this one, on page 9 at this address:
http://www.pocketgpsworld.com/modules.php?name=Forums&file=viewtopic&t=16489&postdays=0&postorder=asc&start=120.

I thought it might be useful for others to learn how I got this to work with Excel. Credit for the code lies with Lutz Bendlin, all I have done is get it to work (see ‘Credit where it is due’ below).

The following is very much a ‘first draft’ as I can see considerable room for improvement in the code itself and in the execution; when I have a bit more lifewidth, I’ll knock this into a nice executable, perhaps with an .ini file to hold the filenames of the sound files (unless someone else with a bit more time beats me to it!). For now though, this is a quick and dirty guide to getting Lutz’s code to work in Excel and a set of directions on how to apply it.

Disclaimer: These instructions were created for use with Office XP and I only have TomTom Navigator for Palm OS – They will probably work with other versions of Office and with Pocket PC/smart-phone platforms, but I have not tested them on anything else. I take no responsibility for your use or interpretation of my guide or directions on the use of the code – you do so entirely at your own risk.

1. First you need to record the sounds you want use for your POIs – These need to be in .ogg format and you should refer to the link above for more information on the sampling frequencies appropriate for your device. For the Palm, I recorded in 1600MHz Mono PCM WAV format and converted the files to .ogg format with oggenc from Vorbis: a free command-line utility. You might like to refer to my previous post on voice files for more information:
http://www.pocketgpsworld.com/modules.php?name=Forums&file=viewtopic&t=16637.

2. You can record 15 different POI warning sounds, but you should keep a note of what they are for, as they will still appear in your TomTom software as ‘Beep 1’, ‘Bell 1’ etc – the names seem to be hard-coded into the software (unless anyone knows different…?). Fortunately, you will make an Excel sheet as part of this process, so you will have a record of which sound files map to which warning name. I made-do with just 4 warnings for speed cameras and then made others for other POIs like petrol stations and cash-points etc. This is entirely up to you.

3. When you have made your sound files and converted then to .ogg format, save them in C:\tomtom\UKVoices in order to make sure that the code supplied will work without further modification – you can obviously fiddle with the paths later if you want to.

That’s the sound-file bit done, now onto the code:
4. Open a new Excel spreadsheet

5. Save the file (let’s call it TomTom POI Convertor.xls)

6. Go to Tools|Macro|Visual Basic Editor

7. In the VB editor, double-click ‘sheet 1(sheet 1)’ under the heading Microsoft Excel Objects

8. Paste in the whole of Lutz’s code (See the foot of this posting for a copy, pasted in for your convenience, but with my own small modification for the source folder location)

9. Cut the following two blocks of code from the top of the code in the ‘sheet 1(sheet 1)’ Objects:
Type CHKentry
offset As Long
sourceoffset As Long
length As Long
tag As Byte
packtype As Byte
blocks As Integer
ogglength As Long
End Type


And:
Dim entry() As CHKentry

10. Right-click on ‘Microsoft Excel Objects’ and select ‘Insert|Module’. This will create ‘Module 1’ under the heading ‘Modules’

11. Paste the two blocks of code from step 9 (above) into ‘Module 1’ under the heading ‘Modules’, which you can find in the tree to the left of the code window. Make sure that the code window for ‘Module 1’ shows the headings ‘(General)’ and ‘(Declarations)’ in the pull-downs before you paste in the code.

12. Now change the last line listed above (Dim entry() As CHKentry) to read:
Public entry() As CHKentry

13. Still the ‘Module 1’ add the following two lines at the top:

Public fnum
Public fnum2


14. We’re done with ‘Module 1’ now, so save what you have done so far and click back to ‘sheet 1(sheet 1)’ under the heading Microsoft Excel Objects.

15. Locate the line that reads:

Debug.Print "Done - real new file size is "; FileLen(folder & Cells(1, 3) & "\" & fname & "_new.data.chk")

16. Replace that line with this code:

MsgBox ("Done - real new file size is " & FileLen(folder & Cells(1, 3) & "\" & fname & "_new.data.chk"))

This will give you a friendly message box when the process is complete.

17. Save the code and switch windows to your spreadsheet.

Now you have to make a simple spreadsheet on Sheet 1 of your spreadsheet. This is no time to get fancy by changing the names of sheets or folders etc. Just leave everything as default to start with to guarantee that it will work.

18. Using the tabulated form that Lutz Bendlin posted (also pasted at the foot of this posting for your convenience), enter your filenames from cell C2 to C31. Being a Palm owner, I made no use of lines 17 onwards and I am not sure of the function of line 32. However, it works if you leave it there as listed and this is just a ‘quick and dirty’...

NOTE: All your sound files must have names that do not contain spaces (use underscores if it helps). You must also use only the filename and the extension – do not put the path as the code already expects to find the files in C:\TomTom\UKVoices.

19. Still looking at ‘Sheet 1’ of your spreadsheet, make sure you can see the ‘Control Toolbox’ toolbar (View|Toolbars|Control Toolbox).

20. Change to ‘Design Mode’ by clicking the button with a blue set-square on it.

21. Drag a command button to any convenient space on your sheet and make resize it to look neat.

22. If you like, you can change the Caption text on the button to ‘RUN’ or anything else you think it appropriate (Right-click, select ‘Properties’ and edit ‘Caption’).

23. Now, right-click on the command button and select ‘View Code’. This will return you to the VB editor and you will find that it has already made an entry for the new command button.

24. Between the lines:
Private Sub CommandButton1_Click()
and
End Sub,
Add the following:
data_chk_reload

25. Now save the VB code and close the VB editor

26. Return to the Excel sheet and exit Design Mode by clicking the button with a blue set-square on it again.

27. Save your spreadsheet.

Before you can use the tool to pack your new sounds into a new DATA.CHK file, you have just a few more steps to go:
28. Open Windows Explorer and copy theDATA.CHK from the \TomTom folder on your TomTom removable media card.

29. Paste this file into C:\TomTom and rename it to 2852.data.chk

30. You should now be ready to make a new file. Switch to your Excel sheet and click your command button (the one called RUN or whatever you decided to name it).

31. Now wait...(It can take a few minutes even on a fast PC). When the process is complete, you should hear a bleep and get a message box telling you that the process has finished.

32. The new DATA.CHK file will be in your C:\TomTom\UKVoices folder and it will be called 2852_new.data.chk.

33. Copy the new file to your removable media \TomTom folder, rename the old DATA.CHK to something like DATA._HK, so you don’t lose the original, and then rename 2852_new.data.chk to DATA.CHK.

34. Start TomTom Navigator and check that it works!

Enjoy!

TomTomTim

Credit where it is due:
My thanks to Alex Graf (author of Viftool) for providing me with help when changing spoken voice commands in TomTom Navigator – experience which was crucial to my understanding of what to do with the POI warning sounds.

Thanks also to Lutz Bendlin for sharing the code that this posting is all about. Without his work, we’d all be doing this from scratch.

Thanks also to Dave Francis, a good friend and skilled programmer, who gave precious time on a rare visit to the UK to help me figure out how to make this work.

For my part, I claim nothing except that I have spent a Sunday afternoon typing this up when I should have been doing other stuff. Please make sure you credit Lutz if you use his code and remember that he made it available to the public domain, so it would be wrong to try to make money from it or its use.


For reference
Here is all of Lutz Bendlin’s code and the outline for the spreadsheet you will need for step 18 (above) - First the code (with the source folder entry modified):

Quote:


Sub data_chk_reload()
Type CHKentry
offset As Long
sourceoffset As Long
length As Long
tag As Byte
packtype As Byte
blocks As Integer
ogglength As Long
End Type
Dim g As Long
Dim b As Byte
Dim bt As Byte
Dim Maxfiles
Maxfiles = 30
Dim entry() As CHKentry

'this folder holds the original data.chk file
N.B. Following line modified by TomTomTim
folder = "
C:\TomTom\"
'identifier of the data.chk version. complete file name is identifier.data.chk
fname = "2852"
'the OGG files need to be in the subfolder specified by cell C1
fnum = FreeFile
Open folder & fname & ".data.chk" For Binary Access Read As #fnum
flen = FileLen(folder & fname & ".data.chk")
g = get_long
Debug.Print fname; " Number of modules: "; g; " File size: "; flen
If (g <> 102) And (g <> 120) And (g <> 123) And (g <> 136) Then
a = MsgBox("Not a good DATA.CHK file. Please report your build version of the TomTom program to lutz@pocketgpsworld.com", vbOKCancel, "Error - wrong file version")
Close
Exit Sub
End If
'get offsets
If g = 102 Then Maxfiles = 12
ReDim entry(g + 1)
For i = 1 To g + 1
entry(i).offset = get_long
entry(i).sourceoffset = entry(i).offset
If i > 1 Then entry(i - 1).length = entry(i).offset - entry(i - 1).offset
Next
'confirm file size
If entry(g + 1).offset = flen Then
Debug.Print "File size confirmed"
Else
Debug.Print "File size mismatch! Reported:" & Hex(entry(g + 1).offset) & " Actual:" & flen
End If

'calculating new offsets etc
Debug.Print "Calculating new parameters"
i = 2
For f = g - Maxfiles To g
If (Cells(i, 3) > vbNullString) And (f < g) Then 'new file
Debug.Print "Verifying "; Cells(i, 3)
flen = FileLen(folder & Cells(1, 3) & "\" & Cells(i, 3))
entry(f).ogglength = flen
pad = 0
While flen Mod 4 <> 0
flen = flen + 1
pad = pad + 1

Wend
entry(f).blocks = (flen + 12) / 4
entry(f).length = flen + 16
End If
i = i + 1
Next

'recalculate header
Debug.Print "Recalculating header ";
For i = g - Maxfiles To g + 1
entry(i).offset = entry(i - 1).offset + entry(i - 1).length
Next
Debug.Print "- new File Size is "; entry(g + 1).offset

'write output file
Debug.Print "Writing CHK file "
On Error Resume Next
Kill folder & Cells(1, 3) & "\" & fname & "_new.data.chk"
On Error GoTo 0
fnum2 = FreeFile
Open folder & Cells(1, 3) & "\" & fname & "_new.data.chk" For Binary Access Write As #fnum2

'write header
'number of segments
put_long (g)
'offsets
For i = 1 To g + 1
put_long (entry(i).offset)
Next
'non-voice files
'position pointer
Get #fnum, entry(1).offset, b
h = entry(g - Maxfiles).offset - entry(1).offset
For i = 1 To h
Get #fnum, , b
Put #fnum2, , b
DoEvents
Next

'write sound files, either from source or from new OGG
Debug.Print "Writing CHK file - Sounds"
i = 2
For f = g - Maxfiles To g
If (Cells(i, 3) > vbNullString) And (f < g) Then 'read new file
Debug.Print "Including "; Cells(i, 3); " for "; Cells(i, 1)
'recreate header
b = 1
Put #fnum2, , b
b = 0
Put #fnum2, , b
b = entry(f).blocks \ 256
Put #fnum2, , b
b = entry(f).blocks And 255
Put #fnum2, , b
put_long (1)
put_long (8)
put_long (entry(f).ogglength)
fout = FreeFile
Open folder & Cells(1, 3) & "\" & Cells(i, 3) For Binary Access Read As #fout
For h = 1 To entry(f).ogglength
Get #fout, , b
Put #fnum2, , b
DoEvents
Next
'padding
b = 0
flen = entry(f).ogglength
While flen Mod 4 <> 0
Put #fnum2, , b
flen = flen + 1
Wend
Close (fout)
Else 'read from source
'position pointer
Get #fnum, entry(f).sourceoffset, b
For h = 1 To entry(f).length
Get #fnum, , b
Put #fnum2, , b
DoEvents
Next
End If
i = i + 1
Next
Close
Beep
Debug.Print "Done - real new file size is "; FileLen(folder & Cells(1, 3) & "\" & fname & "_new.data.chk")


End Sub

'required because of the little endian storage of long values
Function get_long() As Long
Dim b As Byte
l = 0
For h = 1 To 4
Get #fnum, , b
l = l * 256 + b
Next
get_long = l
End Function
Sub put_long(ByVal l As Long)
Dim b(4) As Byte
For h = 1 To 4
b(h) = l And 255
l = l \ 256
Next
For h = 4 To 1 Step -1
Put #fnum2, , b(h)
Next
End Sub



And now the spreadsheet:


Quote:


Name Sampling UKVoices
Beep 1 11025 Beep_1_gatso.wav22.ogg
Beep 2 11025 Beep_2_gatso_thirty.wav22.ogg
Beep 3 11025 Beep_3_gatso_forty.wav22.ogg
Beep 4 11025 Beep_4_gatso_fifty.wav22.ogg
Beep 5 11025 Beep_5_gatso_sixty.wav22.ogg
Bell 1 11025 Bell_1_mobile.wav22.ogg
Bell 2 11025 Bell_2_mobile_thirty.wav22.ogg
Bell 3 11025 Bell_3_mobile_forty.wav22.ogg
Boing 11025 Boing_mobile_fifty.wav22.ogg
Bugle 11025 Bugle_mobile_sixty.wav22.ogg
Cow 11025 Cow_mobile_seventy.wav22.ogg
Cuckoo 11025 Cuckoo_redlight.wav22.ogg
Polite 1 11025 Polite_1_specs.wav22.ogg
Polite 2 11025 Polite_2_temp.wav22.ogg
Polite 3 11025 Polite_3_Credits.wav22.ogg
Beep 1 16000 Beep_1_gatso.wav16.ogg
Beep 2 16000 Beep_2_gatso_thirty.wav16.ogg
Beep 3 16000 Beep_3_gatso_forty.wav16.ogg
Beep 4 16000 Beep_4_gatso_fifty.wav16.ogg
Beep 5 16000 Beep_5_gatso_sixty.wav16.ogg
Bell 1 16000 Bell_1_mobile.wav16.ogg
Bell 2 16000 Bell_2_mobile_thirty.wav16.ogg
Bell 3 16000 Bell_3_mobile_forty.wav16.ogg
Boing 16000 Boing_mobile_fifty.wav16.ogg
Bugle 16000 Bugle_mobile_sixty.wav16.ogg
Cow 16000 Cow_mobile_seventy.wav16.ogg
Cuckoo 16000 Cuckoo_redlight.wav16.ogg
Polite 1 16000 Polite_1_specs.wav16.ogg
Polite 2 16000 Polite_2_temp.wav16.ogg
Polite 3 16000 Polite_3_Credits.wav16.ogg
Shutter 11025

GO needs 22050 Hz in first bank
Nokia needs second bank at 16000 Hz


Back to top
View user's profile Send private message







Posted: Today    Post subject: Pocket GPS Advertising

Back to top
Display posts from previous:   
Post new topic   Reply to topic    Pocket GPS World Forum Index -> TomTom Portable Navigation Devices All times are GMT + 1 Hour
Goto page Previous  1, 2, 3 ... 8, 9, 10 ... 71, 72, 73  Next
Page 9 of 73

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Make a Donation



CamerAlert Database

Click here for the PocketGPSWorld.com Speed Camera Database

Download Speed Camera Database
22.051 (01 May 24)



WORLDWIDE SPEED CAMERA SPOTTERS WANTED!

Click here to submit camera positions to the PocketGPSWorld.com Speed Camera Database


12mth Subscriber memberships awarded every week for verified new camera reports!

Submit Speed Camera Locations Now


CamerAlert Apps



iOS QR Code






Android QR Code







© Terms & Privacy


GPS Shopping