Life In 19x19
http://www.lifein19x19.com/

Go Audio Lesson Tool
http://www.lifein19x19.com/viewtopic.php?f=18&t=941
Page 1 of 3

Author:  Li Kao [ Thu Jun 24, 2010 9:59 am ]
Post subject:  Go Audio Lesson Tool

What is it?
Since there is a lack of free Audio lessons and existing tools like Livestream create low quality videos which can't be downloaded easily I've created this tool so everybody who wants can create audio teaching games which can be shared as a simple file.
This is the first usable alpha release, so it's not feature complete yet and probably still has some bugs.
Requires Windows and .NET framework 3.5 SP1

Features:
* Records and plays Audio-Lessons
* Marker and review tools similar to KGS. One difference is that secondary Actions are used with the right mouse-button
* Game Variation Tree

Known Issues:
* Most commands in the game and navigation menus are not implemented yet
* It sometimes doesn't play the last second of a lesson

Planned for later versions:
* SGF Import/Export
* Multiplayer

GitHub
Source Code
Download

Attachments:
GoAudioLessonTool.png
GoAudioLessonTool.png [ 24.27 KiB | Viewed 23366 times ]

Author:  rubin427 [ Thu Jun 24, 2010 10:11 am ]
Post subject:  Re: Go Audio Lesson Tool

This is a very interesting project.

1) Is there any chance you might be releaseing the code?
2) Do you care to go into any detail about the file format you use to store the game reviews? Is there any hope of other applications being able to support the format?

Author:  Li Kao [ Thu Jun 24, 2010 10:17 am ]
Post subject:  Re: Go Audio Lesson Tool

rubin427 wrote:
This is a very interesting project.

1) Is there any chance you might be releaseing the code?
2) Do you care to go into any detail about the file format you use to store the game reviews? Is there any hope of other applications being able to support the format?


1) Yes I'll release to code at some point in the future. But I need to choose a licence, check the licence of the libraries,... so it might take some time. If somebody is interested I can share the code with him now, I just don't want to release it to the public before cleaning it up and taking care of licensing.
2) Currently it uses a zip container(might change in the future to support streaming).
Inside the .zip file there is a ogg-vorbis encoded audiofile and a textfile in my own format containing the replay.
I didn't use sgf internally since sgf didn't seem suitable to record the time based changes to the game tree. But since the format isn't completely stable yet it's too early to support it elsewhere. And the time based content probably requires a code structure a bit different from what a normal sgf editor uses.

Author:  rubin427 [ Thu Jun 24, 2010 10:45 am ]
Post subject:  Re: Go Audio Lesson Tool

Li Kao wrote:

Inside the .zip file there is a ogg-vorbis encoded audiofile and a textfile in my own format containing the replay.


Nice choice.

Tonight I'll have to figure out where I put my windows hard drive (bookshelf, maybe) and give your software a try.

Author:  Tryphon [ Thu Jun 24, 2010 3:16 pm ]
Post subject:  Re: Go Audio Lesson Tool

If the tool could allow to record an audio comment from KGS, it'd be paradise :)

Author:  ethanb [ Thu Jun 24, 2010 4:50 pm ]
Post subject:  Re: Go Audio Lesson Tool

Li Kao wrote:
rubin427 wrote:
This is a very interesting project.

1) Is there any chance you might be releaseing the code?
2) Do you care to go into any detail about the file format you use to store the game reviews? Is there any hope of other applications being able to support the format?


1) Yes I'll release to code at some point in the future. But I need to choose a licence, check the licence of the libraries,... so it might take some time. If somebody is interested I can share the code with him now, I just don't want to release it to the public before cleaning it up and taking care of licensing.
2) Currently it uses a zip container(might change in the future to support streaming).
Inside the .zip file there is a ogg-vorbis encoded audiofile and a textfile in my own format containing the replay.
I didn't use sgf internally since sgf didn't seem suitable to record the time based changes to the game tree. But since the format isn't completely stable yet it's too early to support it elsewhere. And the time based content probably requires a code structure a bit different from what a normal sgf editor uses.



Since people probably aren't going to be extracting the SGF files from your archive format and using them as-is in a database tool or something, you should be able to abuse the BL/WL codes to provide timestamping for the audio sync.

In the case of branch traversal during the lecture, you could put multiple timestamps on the node in the file and mangle it in memory on import to create a linear array of board positions with associated timestamps.

If you provide an SGF export function, you can just strip out the BL and WL properties for each node on export - many SGF readers don't pay attention to them anyway (although Quarry does!) and they're optional, not essential.

You could also create your own unique property TS (time sync) or something and again, strip it out when you export the SGF file.

Seems like doing that would serve the purpose quite well and also make importing files from other programs much easier; the work is already done apart from recording the audio.

Edit with pseudo gametree for demonstration:

root node: game info
node 1: B, TS=00:00:00
node 2: W, TS=00:43:78
node 3: B, TS=01:00:03, TS=01:50:47, TS=02:46:90
node 4: W, TS=01:33:22, TS=02:47:64
node 5: B, TS=02:56:00
node 4A (variation): W, TS=01:57:02

On reading the file the full board position would be calculated for each node, and then pointers to the board positions would be pushed into the appropriate place in the array sorted by timestamp. Then calculate elapsed time after starting the audio and draw the position from the associated pointer when you reach the next timestamp.

TS=00:00:00, display board as in node 1
("This is the second title match of the 21st Honinbo, blah blah")
TS=00:43:78, display node 2
("White plays here and offers a diagonal fuseki")
TS=01:00:03, node 3
("Black plays in the bottom right and it'll be a parallel opening")
TS=01:33:22, node 4
("Ok, so it's normal so far. For beginners, what I meant by diagonal was...")
TS=01:50:47, node 3 [lecturer went back one move]
TS=01:57:02, node 4A [lecturer played a move to make a new variation]
("Black could play here, and it would probably be a fighting game.")
TS=02:46:90, node 3 [lecturer went back to 3]
TS=02:47:64, node 4 [then back to the real 4th move]
("But he didn't, so it's like this.")
TS=02:56:00, node 5
("And white approaches...")

Author:  tchan001 [ Thu Jun 24, 2010 6:53 pm ]
Post subject:  Re: Go Audio Lesson Tool

You might also want to take a look at Multigo which also has audio commentary recording capabilities to go with game records.

http://www.ruijiang.com/multigo/features.php

Author:  fwiffo [ Thu Jun 24, 2010 9:27 pm ]
Post subject:  Re: Go Audio Lesson Tool

Have you considered using a speech-specific codec like speex to save on file size?

Author:  Li Kao [ Fri Jun 25, 2010 12:57 am ]
Post subject:  Re: Go Audio Lesson Tool

Tryphon wrote:
If the tool could allow to record an audio comment from KGS, it'd be paradise :)

I might work on that, but probably only for the person giving the lecture. I don't want people to be able to record KGS+. But I'd like to allow recording of free lectures (like those by Battousai).

@ethanb
I'll use a similar format for sgf-export. You can use undefined tags when writing SGF and SGF readers need to ignore&preserve them.
I won't use it as internal format since several features(Multiplayer,Cursor display) would be more annoying when using sgf. Also Sgf can't cope with a stone or label being added and removed in the same node.

@fwiffo
I considered speex. But the main advantage of Speex is low latency. The lowest vorbis quality(Q0, about 30kbit/s, I'm currently using Q3 but will probably use something lower) should be small enough. The main advantage of vorbis is html5 support. And I'd like to have a javascript+html5 player.

Author:  CarlJung [ Fri Jun 25, 2010 2:08 am ]
Post subject:  Re: Go Audio Lesson Tool

Li Kao wrote:
Also Sgf can't cope with a stone or label being added and removed in the same node.


Why is it necessary to have have them in the same node?
What's wrong with:

Code:
;B[dd]
;AE[dd]

Author:  ethanb [ Fri Jun 25, 2010 6:13 am ]
Post subject:  Re: Go Audio Lesson Tool

Li Kao wrote:
Also Sgf can't cope with a stone or label being added and removed in the same node.


If you think you have a reason to add and remove the same stone in one node, I'm pretty sure you're confused about how the SGF format works. If you add a black stone at tengen, and remove it at the exact same time, what exactly are you hoping will display on the screen?

Author:  Harleqin [ Fri Jun 25, 2010 6:47 am ]
Post subject:  Re: Go Audio Lesson Tool

ethanb wrote:
Li Kao wrote:
Also Sgf can't cope with a stone or label being added and removed in the same node.


If you think you have a reason to add and remove the same stone in one node, I'm pretty sure you're confused about how the SGF format works. If you add a black stone at tengen, and remove it at the exact same time, what exactly are you hoping will display on the screen?


That is the point: a lesson does not simply follow the SGF nodes, it jumps around and perhaps even changes them. Therefore, it is conceptually not possible to incorporate such a lesson into an SGF file. Instead, you need a format that describes the actions; this format can operate on an SGF file.

The alternative is of course to have prepared slides, but this means that the teacher has more work before the lesson.

Author:  ethanb [ Fri Jun 25, 2010 7:12 am ]
Post subject:  Re: Go Audio Lesson Tool

Harleqin wrote:
ethanb wrote:
Li Kao wrote:
Also Sgf can't cope with a stone or label being added and removed in the same node.


If you think you have a reason to add and remove the same stone in one node, I'm pretty sure you're confused about how the SGF format works. If you add a black stone at tengen, and remove it at the exact same time, what exactly are you hoping will display on the screen?


That is the point: a lesson does not simply follow the SGF nodes, it jumps around and perhaps even changes them. Therefore, it is conceptually not possible to incorporate such a lesson into an SGF file. Instead, you need a format that describes the actions; this format can operate on an SGF file.

The alternative is of course to have prepared slides, but this means that the teacher has more work before the lesson.


Did you read my earlier post? You put multiple timestamps in the node, so that it says "display this at 15 seconds in, 75 seconds in, and 92 seconds into the audio stream."

EDIT: you may have a similar (but quite understandable!) misconception about the SGF tree. An SGF node does not equal a game move. An SGF node is simply a unit of logical delineation which may have any number of attributes associated with it, one of which MAY be a game move. So when the lecturer adds a label to an existing position while recording the audio commentary, it would create a new node with no additional moves, but a label (and audio timestamp) only.

Author:  Li Kao [ Fri Jun 25, 2010 7:30 am ]
Post subject:  Re: Go Audio Lesson Tool

ethanb wrote:
Li Kao wrote:
Also Sgf can't cope with a stone or label being added and removed in the same node.


If you think you have a reason to add and remove the same stone in one node, I'm pretty sure you're confused about how the SGF format works. If you add a black stone at tengen, and remove it at the exact same time, what exactly are you hoping will display on the screen?

If I add it, and remove it 0.5s later I expect the stone to be visible for 0.5s.

Of course I could follow CarlJung and create a new node each time. But is annoying for two reasons:
1) It creates a lot more nodes than a normal sgf editor would create (each click of the user=new node)
2) I need to copy all decorations(Labels) from the previous node which inflates the file and is annoying to work with.

I think an action sequence is more appropriate to achieve video like behavior. At each point in time I have a game-tree which basically corresponds to a normal sgf-file.
I'll add a export function for the format you suggested, but the export probably loses a bit of information.
But if other coders think that this export is useful I can add it as a non authoritative version into the zip file.

IMO the most important features to add ATM are KGS recording and sgf import.

Author:  ethanb [ Fri Jun 25, 2010 7:40 am ]
Post subject:  Re: Go Audio Lesson Tool

Li Kao wrote:
ethanb wrote:
Li Kao wrote:
Also Sgf can't cope with a stone or label being added and removed in the same node.


If you think you have a reason to add and remove the same stone in one node, I'm pretty sure you're confused about how the SGF format works. If you add a black stone at tengen, and remove it at the exact same time, what exactly are you hoping will display on the screen?

If I add it, and remove it 0.5s later I expect the stone to be visible for 0.5s.

Of course I could follow CarlJung and create a new node each time. But is annoying for two reasons:
1) It creates a lot more nodes than a normal sgf editor would create (each click of the user=new node)
2) I need to copy all decorations(Labels) from the previous node which inflates the file and is annoying to work with.

I think an action sequence is more appropriate to achieve video like behavior. At each point in time I have a game-tree which basically corresponds to a normal sgf-file.
I'll add a export function for the format you suggested, but the export probably loses a bit of information.
But if other coders think that this export is useful I can add it as a non authoritative version into the zip file.

IMO the most important features to add ATM are KGS recording and sgf import.


Ah well, I'm not trying to turn this into a religious war over architecture - you're making a tool which will be useful to everybody, use whatever format you like.

I just think there's a way you can do it without "reinventing the wheel" internally (yeah, you'd want to mangle the dataset on export anyway so you wouldn't have 16 "empty" label nodes) but if you're already where you want to be with your data structure, that's cool. :)

Author:  Harleqin [ Fri Jun 25, 2010 11:37 am ]
Post subject:  Re: Go Audio Lesson Tool

ethanb wrote:
Harleqin wrote:
That is the point: a lesson does not simply follow the SGF nodes, it jumps around and perhaps even changes them. Therefore, it is conceptually not possible to incorporate such a lesson into an SGF file. Instead, you need a format that describes the actions; this format can operate on an SGF file.

The alternative is of course to have prepared slides, but this means that the teacher has more work before the lesson.


Did you read my earlier post? You put multiple timestamps in the node, so that it says "display this at 15 seconds in, 75 seconds in, and 92 seconds into the audio stream."

EDIT: you may have a similar (but quite understandable!) misconception about the SGF tree. An SGF node does not equal a game move. An SGF node is simply a unit of logical delineation which may have any number of attributes associated with it, one of which MAY be a game move. So when the lecturer adds a label to an existing position while recording the audio commentary, it would create a new node with no additional moves, but a label (and audio timestamp) only.


I was talking about the conceptual level. Yes, it is possible to do it with time stamps mangled into the SGF file, but it has to be compared to the alternative, which is much easier to parse and write (example syntax):

Code:
(00:00:00 sgf 0 (;GM[1]...
  ))
(00:00:10 next-node)
(00:00:12 next-node)
(00:00:14 next-node)
(00:00:18 next-node)
(00:00:30 jump-to-node 58)
(00:01:03 mark-circle c i)
(00:03:54 move black c j)
.
.
.
(00:24:27 sgf 1 (;GM[1]...
  ))
(00:25:43 jump-to-node 34)
(00:27:05 jump-to-sgf 0)
.
.
.


This format describes what is actually supposed to happen, and seems much more flexible to me. Anyway, what I am aiming at is that the teacher's actions are orthogonal to the SGF tree. You might be successful in trying to press them into the tree itself, but I think that the way I show above is much easier to understand and implement. Still in other words: the SGF file is contained in the lesson, not the other way around (there may even be more than one SGF file in a lesson, as shown above).

Li Kao seems to use a similar approach.

Author:  ethanb [ Fri Jun 25, 2010 5:59 pm ]
Post subject:  Re: Go Audio Lesson Tool

Harleqin wrote:
ethanb wrote:
Harleqin wrote:
That is the point: a lesson does not simply follow the SGF nodes, it jumps around and perhaps even changes them. Therefore, it is conceptually not possible to incorporate such a lesson into an SGF file. Instead, you need a format that describes the actions; this format can operate on an SGF file.

The alternative is of course to have prepared slides, but this means that the teacher has more work before the lesson.


Did you read my earlier post? You put multiple timestamps in the node, so that it says "display this at 15 seconds in, 75 seconds in, and 92 seconds into the audio stream."

EDIT: you may have a similar (but quite understandable!) misconception about the SGF tree. An SGF node does not equal a game move. An SGF node is simply a unit of logical delineation which may have any number of attributes associated with it, one of which MAY be a game move. So when the lecturer adds a label to an existing position while recording the audio commentary, it would create a new node with no additional moves, but a label (and audio timestamp) only.


I was talking about the conceptual level. Yes, it is possible to do it with time stamps mangled into the SGF file, but it has to be compared to the alternative, which is much easier to parse and write (example syntax):

Code:
(00:00:00 sgf 0 (;GM[1]...
  ))
(00:00:10 next-node)
(00:00:12 next-node)
(00:00:14 next-node)
(00:00:18 next-node)
(00:00:30 jump-to-node 58)
(00:01:03 mark-circle c i)
(00:03:54 move black c j)
.
.
.
(00:24:27 sgf 1 (;GM[1]...
  ))
(00:25:43 jump-to-node 34)
(00:27:05 jump-to-sgf 0)
.
.
.


This format describes what is actually supposed to happen, and seems much more flexible to me. Anyway, what I am aiming at is that the teacher's actions are orthogonal to the SGF tree. You might be successful in trying to press them into the tree itself, but I think that the way I show above is much easier to understand and implement. Still in other words: the SGF file is contained in the lesson, not the other way around (there may even be more than one SGF file in a lesson, as shown above).

Li Kao seems to use a similar approach.


It's more flexible in terms of what you can do with it, for sure - I was just saying he could get SGF import and export "for free" this way and if his file structure on disk is in a similar format (of course the memory structures should be as you describe when loaded from disk, which is also what I said in my earlier post with the example) then his entire file-processing function set becomes pretty clean. I like reusable code. :)

Author:  Harleqin [ Sat Jun 26, 2010 3:00 am ]
Post subject:  Re: Go Audio Lesson Tool

ethanb wrote:
It's more flexible in terms of what you can do with it, for sure - I was just saying he could get SGF import and export "for free" this way and if his file structure on disk is in a similar format (of course the memory structures should be as you describe when loaded from disk, which is also what I said in my earlier post with the example) then his entire file-processing function set becomes pretty clean. I like reusable code. :)


What is clean about sprinkling the actions (which are linear in time and orthogonal to the game tree) into the game tree? Your file parsing would have to collect the actions together and sort them, and your file writing would have to distribute them into the different nodes.

I guess that you want to put this mangling code before the SGF writing, so that you can reuse the SGF writing code. I want the SGF writing before the lesson file writing code, so I get to reuse, too.
:ugeek:

Author:  Li Kao [ Sun Jun 27, 2010 12:15 pm ]
Post subject:  Re: Go Audio Lesson Tool

I now have image recognition which creates screenshots of a kgs window and recognizes the stones and markers(Triangle,Circle,Square) in them.
And I have basic sgf loading support.
So I have to figure out how to combine the scanned data with a sgf-file of the game and the audio to create an actual replay of a KGS (teaching) game.

Author:  FrankdeGroot [ Mon Jun 28, 2010 3:55 am ]
Post subject:  Re: Go Audio Lesson Tool

Moyo Go Studio has the ability to record audio (using speex). The advantage is that the audio is included as standard SGF. Moyo Go can be freely downloaded.

Page 1 of 3 All times are UTC - 8 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/