soundfiles continued

19 views
Skip to first unread message

hennyj...@planet.nl

unread,
Jan 8, 2021, 5:54:44 AM1/8/21
to hotpotat...@googlegroups.com

Dag Martin,

I hope this is what you mean.?

Hgv, Henny

zin.01.jmx
zin.02.jmx

Martin Holmes

unread,
Jan 8, 2021, 10:25:05 AM1/8/21
to hotpotat...@googlegroups.com
That's it! Thanks, I'll try to come up with a regex for this.

Cheers,
Martin
> --
> You received this message because you are subscribed to the Google
> Groups "hotpotatoesusers" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to hotpotatoesuse...@googlegroups.com
> <mailto:hotpotatoesuse...@googlegroups.com>.
> To view this discussion on the web, visit
> https://groups.google.com/d/msgid/hotpotatoesusers/006801d6e5ac%24abb80db0%2403282910%24%40planet.nl
> <https://groups.google.com/d/msgid/hotpotatoesusers/006801d6e5ac%24abb80db0%2403282910%24%40planet.nl?utm_medium=email&utm_source=footer>.

Martin Holmes

unread,
Jan 8, 2021, 2:17:55 PM1/8/21
to hotpotat...@googlegroups.com
Hi Henny,

Only zin01 contains an audio object as far as I can see. I'll work with
that one.

Cheers,
Martin

On 2021-01-08 2:54 a.m., hennyj...@planet.nl wrote:

Martin Holmes

unread,
Jan 8, 2021, 2:49:08 PM1/8/21
to hotpotat...@googlegroups.com
I have a regex that works for Henny's file, and should probably work for
other similar ones, doing a search-and-replace on the HotPot data file
in Notepad++.

Find (all on one line):

&amp;#x003C;object
type=&quot;application/x-shockwave-flash.+TheSound=([^&]+).+#x003C;/object&amp;#x003E;

Replace with: (all on one line):

&amp;#x003C;audio
controls=&quot;controls&quot;&amp;#x003E;&amp;#x003C;source=&quot;$1&quot;
type=&quot;audio/mp3&quot;/&amp;#x003E;&amp;#x003C;/audio&amp;#x003E;

Settings choose "Regular expression", and check ". matches newline."

This should replace an old Flash object using the Half-Baked SWF widget
to play mp3s with an equivalent HTML5 audio element.

I haven't tested the result, and you may want to tweak it for your own
preferences in the output.

Cheers,
Martin

Agnès S.

unread,
Jan 9, 2021, 11:05:50 AM1/9/21
to hotpotat...@googlegroups.com
Thanks Martin.

I've made a text to explain your regex for replacing an old Flash object
in a data file and in the htm file.
http://hpaddons.free.fr/trucs/explanation_code.pdf
I hope it will be useful for those who have a different code for their
old Flash object (and will have to adapt the regex) and those who just
would like to understand the regex.
Martin, you can do any remark about my explanations.

Martin, if Henny converts the data files with your regex she will have
to recreate every htm file. Can she do that in a batch process?

Cheers,
Agnès S.

Martin Holmes

unread,
Jan 9, 2021, 4:33:39 PM1/9/21
to hotpotat...@googlegroups.com
Hi Agnès,

Your explanation is perfect!

If the exercises are not already part of Masher sequences, then it is
possible to write a script to compile them all, but that might be very
tricky if you have used custom source files. This part of undoc.txt
explains how you might do this:

---
Using the command-line switch /V7, you can automatically run a Hot
Potato, passing it the name of a file to open, and the name of a
configuration file, an HTML file to export to, the path to source files
you want to use, and the "next exercise" URL, and have the program
create standard version 7 output then close automatically without
showing its screen at all. Here's an example:

c:\HotPotatoes6\JCloze.exe /V7 c:\MyHotPotFiles\gapfill.jcl
c:\MyHotPotFiles\config.cfg c:\MyWebPages\gapfill.htm
c:\HotPotatoes7\source nextexercise.htm /s

This will silently run JCloze, open the file "gapfill.jcl", export it to
create a V7 web page called "gapfill.htm", then exit without even
showing its splash screen (the final /s suppresses the splash screen).

For JMatch and JMix, /V7Drag will create a drag-drop output, and for
JMatch only, /V7Flash will create a flashcard exercise.
---

Generally, though, I think it would be better to recreate each file
separately so you can test them as you go. You can never be sure the
search-and-replace has found exactly what was expected and produced
exactly what you want.

Cheers,
Martin

Agnès S.

unread,
Jan 12, 2021, 4:05:44 AM1/12/21
to hotpotat...@googlegroups.com
Hi Martin,

I've tested your regex with different HP programs and noticed two points:
* After having created the htm with the modified data file, I can see
the audio control but not hear the sound. I think that's because you
omitted src in the replace part.
Everything is correct with
;&amp;#x003E;&amp;#x003C;source src=&quot;$1&quot;
type=&quot;audio/mp3&quot;/&amp;#x003E;&amp;#x003C;/audio&amp;#x003E;

* If there's two or more audio objects in the data file the search regex
matches the characters from the beginning of the first one to the end of
the the last one (greedy search). Of course, after the replacement it's
a mess!
So I've modified the search regex using a lazy mode:
&amp;#x003C;object
type=&quot;application/x-shockwave-flash.+?TheSound=([^&]+).+?#x003C;/object&amp;#x003E;

I've tested that in a JQuiz where every question was an audio
element.Till now everything seems correct.

Cheers
Agnes S.

Martin Holmes

unread,
Jan 12, 2021, 10:22:19 AM1/12/21
to hotpotat...@googlegroups.com
Hi Agnès,

Thanks for fixing this. I was indeed only assuming a single audio item
per file, and some regex engines don't support non-greedy mode. The .+?#
could also be [^#]+, I think, if non-greedy is not supported.

If the 2001 version of Delphi that Hot Potatoes is written in had any
support for regular expressions, I could add this to HotPot 7 and
convert these things automatically, but it doesn't. :-(

Cheers,
Martin

Agnès S.

unread,
Jan 20, 2021, 5:55:53 AM1/20/21
to hotpotat...@googlegroups.com
I've made a tutorial to explain the way to do the conversion with Notepad++:
http://hpaddons.free.fr/tips/audio/tuto_convert_audio_HP6_to_HP7.pdf

Cheers,
Agnès S.

henny jellema

unread,
Jan 22, 2021, 2:44:32 PM1/22/21
to agnes...@gmail.com, hotpotatoesusers
Dag Agnés,
I have not yet fixed and understand this, but thank you for all that effort anyway.
This  weekend I go "er vol tegenaan"   😀and will let you know how far I come.
Hartelijke groet, Henny

Op wo 20 jan. 2021 om 11:55 schreef Agnès S. <agnes...@gmail.com>:
To unsubscribe from this group and stop receiving emails from it, send an email to hotpotatoesuse...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/hotpotatoesusers/a723fb14-acb8-4004-1aa5-6ecba6263a09%40gmail.com.


--

Pascal Scalpa

unread,
Mar 7, 2021, 2:23:53 PM3/7/21
to hotpotatoesusers
This works for me in the html pages using dewplayer :
(thanks for the tuto, Agnes)

Reply all
Reply to author
Forward
0 new messages