Speex, Gallery, Moodle, and Drupal

I had one (actually, two) of those open-source compatibility days that OSS critics love to cite. Lesson learned: reduce version dependency as much as possible. We were happily plodding along with Moodle 1.6.3 with Gallery 2.1 integrated within, when I decided to try MoodleSpeex for the first time. I have wanted to provide our language teachers with in-browser audio recording for some time now. However, this worthy goal took me down a crazy path.

I installed Speex into Moodle 1.6.3, and it almost nearly worked. I could record from the browser and upload into the files area, but not a forum. The operation would appear to complete successful, but the new file would not show up. I read in the Moodle forums that someone got it working with Moodle 1.7, so I decided to upgrade — all the way to Moodle 1.8. The forum posts suggested that the problem was with Moodle 1.6, which I now realize is not necessarily true.

I had meant to untar Moodle 1.8 into a test directory but accidentally upgraded my live install! Oops. Moodle worked fine (for the most part), but this broke the custom scripts that I have authenticate against Moodle and the Gallery integration plug-in. However, we did get the latest Moodle features, especially the roles feature that will allow us to provide parents and other guests with Moodle course access without enrolling them as students! This was worth the upgrade in itself and perhaps even the trouble I went through.

Fixing our moodlecheck.pm script to play with the new Moodle installation was pretty straightforward. A couple of table name changes did the trick. One strange change was that location headers stopped working when passing the user from a custom script to the Moodle login page. I had to fall back to redirect headers instead. I would like to take another look at that issue soon, as location headers are cleaner.

It took a bit longer to fix Gallery integration. I found out that development of the Gallery plug-in for Moodle is no longer being developed. That’s an open-source nightmare for a very fine plug-in. I figured that I would just bind Gallery directly to LDAP, so that our users would be able to log into Gallery. Much to my surprise, Gallery does not have a LDAP plug-in! Believe it or not, the only way to provide LDAP authentication to Gallery is to enclose it within another application like Moodle … or in this case, Drupal!

Having played a lot with Drupal recently, it seemed natural to try Gallery integration within Drupal. I find Drupal fragile, however. LDAP authentication and Gallery integration seemed to both work fine, but then I had a resolve a strange problem. Once LDAP authentication was enabled, local Drupal users were no longer able to log in! Within ldapauth.module, I found some constants that appear to be in some state of development. Despite the ominous warning, I switched LDAP_FIRST_DRUPAL on, and then my local users were also able to log in. I would love to know what is going on with that module’s project.

// Private constants. Do not touch
define('LDAP_FIRST_DRUPAL', 1);
define('LDAP_FIRST_LDAP', 0);

Back to MoodleSpeex. It still doesn’t work in Moodle 1.8, though further reading suggests that I should have known that to begin with. I was able to hack enough code to get the Speex recorder to display, but then I just had the same problem as with Moodle 1.6 — could record to files, record within a forum, but not save the recorded file within a forum post. I hope that the Speex developer is interested in updating the plugin for Moodle 1.8!

Interesting tidbit. A project team is right on the Moodle 1.8 update, preparing to update their Moodle-Drupal sign-on integration for the new Moodle. Drupal has such a large community of interested developers that their modules seem to keep up faster with change.

A word of hope: I really want (and still don’t have) a way for students to record audio directly into a browser window within Moodle. My fallback is to teach students to record in Audacity, export to MP3, and save a file, but recording directly into Moodle would be way better. Given the popularity of Flash video recorders and players, could we not get a few schools together to sponsor the development of a Moodle Flash-based audio recorder/player? I really don’t know how hard it would be. Your thoughts?

Drupal Gallery


  1. FG says:

    "I hope that the Speex developer is interested in updating the plugin for Moodle 1.8!" The developer of MoodleSpex has discontinued support of all his modules starting with Aug 2006. So, unless someone picks up where he left off (at least *possible* with OSS, something the critics avoid mentioning), you will need to wait for some other solution. The current trend seems to be (unfortunately) towards Macromedia flash-player-based recorder. Red5 is mentioned but while I saw a lot of applications other than voice-record/playback, this one has not been release even as an alpha, yet.

    My dilemma is that my wife (a FL teacher) is moving from a big school using BB to a small college with not even Moodle! I set up Moodle easily enough but she is really hooked on the record functions offered by BB (Wimba, $10K+/yr) and I’m desperately looking for alternatives for Moodle.

  2. rkassissieh says:

    Thanks for that, Filip. I am okay with a Flash-based solution as long as it works! I have some high school students interested in this project, but they won’t begin work for another couple of weeks, so no promises!


  3. Alex Ragone says:

    Hey Richard,

    Would love to see that type of solution — if you find someone, or your students get going, I would be happy to help with the development — really interested in DruaplEd right now.

  4. rkassissieh says:

    Thanks for the offer, Alex. They are planning to give it a go after APs this week.

    I would love to see the same sort of solution for Drupal — no idea how much work it would be.


  5. Uwe says:

    Me too – I’ve been looking for an in-browser recording solution. Speex didn’t quite appeal to me. We’ve been experimenting with Gong http://gong.ust.hk/ but have had difficulties getting the server through our IT infrastructure. It would be the preferable solution – just have a look at the features 😉
    Just recently they brought out a smaller, serverless solution: NanoGong
    Works just fine! The only drawback: manual upload (assignment / forum, but other than that: small, reliable, elegant. Try it!

  6. Daniel Küstner says:

    Dear Richard,

    I’m not sure, if this fits your needs, but I want to point you to the Covcell tools. In the Covcell project, we develop tools for collaborative working in Moodle. It contains a presence awareness block, text chat, audio-video chat, a collaborative whiteboard, and an audio recording assignment type.

    But: although you can already try the tools, they are still in beta stage.

    There is a test installation where you can try the tools out at


    You can download the tools at


  7. rkassissieh says:

    Thank you for contacting me! The audio works great, and I imagined that a Flash-based solution would work better than Java. You have proved that right!

    Have you made a conscious choice not to list your plugins in the Moodle modules database? I know that the Speex fans would welcome your contributions.

    I didn’t see an option for embedding audio in forum discussions. Do you plan to extend it to there? We have a stronger need for asychronous audio messaging than for audio/video chat.


  8. Daniel Küstner says:

    Thanks for the hint to the modules database. We will definitely add this, once the modules are available in a stable version.

    I see the demand for embedding audio in forum discussions. But I fear, this will be beyond our capacity in this project (it’s an EU project that’s funded until September of this year) to implement it.

    However, the flash and the streaming server code that is used for the audio assignment recording is separated from the moodle code and could be reused in an adaption for the forum.