Home   Archive   Permalink

Can R3 deal with Audios & videos?

Is there any functions in R3 which allows one to play a .Mp3 or a .mp4 file?

posted by:   Rex     22-Sep-2014/11:12:17-7:00

Now, I have known 2 methods:
- Method 1 (easy): Execute an external program (mplayer ...)
call/wait {"path/to/program" "path/to/file.mp3"}
Win: call/wait {c:\mplayer\mplayer.exe c:\file.mp3}
Linux: call/wait {mplayer /root/file.mp4}
- Method 2: Call C function from a library (libwmp3.dll ...) (r3-atronix was built with libffi)
R2 scripts: http://www.rebol.org/search.r?find=mp3&form=yes

posted by:   Linh     23-Sep-2014/3:27:47-7:00

You could write out a simple HTML5 file and use the HTML5 player to play the file using the 'browse command.

posted by:   Bo     23-Sep-2014/19:45:33-7:00

Thank you,guys :) Your ways are quite innovative, which I never imagined. But I am wondering how to interact with the external thread? e.g. how can I control the player I called?

posted by:   Rex     25-Sep-2014/7:23:33-7:00

Interacting with a third-party player is difficult. I don't have any ideas for that right now.

posted by:   Bo     25-Sep-2014/20:32:51-7:00

I wrote a bit in http://business-programming.com about doing that in Windows (search for 'autoit'). What platforms do you need to support?

posted by:   Nick     26-Sep-2014/20:15:50-7:00

Will the win MCI commands do it? Can't remember. I have some of those mapped from long ago, though incomplete.

posted by:   Gregg Irwin     27-Sep-2014/1:29:04-7:00

I had one really simple MCI example in the DLL section of the tutorial, but it was limited to playing old AVIs. I don't think the old Windows API (before .NET) supported many media formats. It's probably better to look for a third party solution. That was at least the case when I wrote the libwmp3.dll interface, which is now very old.

posted by:   Nick     27-Sep-2014/6:12:11-7:00

@ Nick
Thanks. I mainly want it to run on windows.
I'll read through your examples to see whether I can understand it. (It seems that the DLL stuff is too advanced topic for me now.)
I am now working on an annotation (i.e. tagging) tool for linguists, and wonder if there is a way to play sound, so that they can tag the audio and the transcription at the same time. This allows them to analyze features such as tone, stress and accent.

posted by:   Rex     28-Sep-2014/2:31:36-7:00

@ Irwin
It appears to me that the current focus of the Rebol community is not on multi-media, and I find few examples on how to deal with audio-videos.
I am also following the heated debated triggered by "an open letter to carl". I think we will win many new users if the community work out a dialect specialized in dealing with multi-media tasks. After all, what Rebol really interests me is its dialects.

posted by:   Rex     28-Sep-2014/2:55:10-7:00

Has Atronix's Dll interface been included in their Windows release?

posted by:   Nick     30-Sep-2014/16:13:43-7:00

Nick, library access is supported on both Linux and Windows. The latest source code is on github.
We are testing a beta of 3.1 now that is Library feature complete. We will be posting new binaries on our website by the end of the month hopefully and will make an official announcement at that time.
If you need this right away and don't want to compile the source, I can give you a private link to a 3.1 beta binary.

posted by:   David den Haring     2-Oct-2014/9:49:33-7:00

Could you please illustrate how to use GUI with Atronix Rebol? I downloaded an interpreter from your website but cannot get it handle GUI dialect.

posted by:   Rex     3-Oct-2014/6:59:40-7:00

To start, you can check at http://learnrebol.com/rebol3_book.html
There are some explanations.

posted by:   GregP     3-Oct-2014/9:28:58-7:00

Rex, if you want to use the R3-GUI environment, make sure to evaluate the load-gui function first.
Please note that this downloads r3-gui.r from the Atronix web site. Our version is tweaked ever so slightly for compatibility with the Atronix build of R3.
Please let me know if something doesn't work with the Learn REBOL tutorial that Greg mentioned.

posted by:   David den Haring     3-Oct-2014/12:33:22-7:00

Thanks David. I'll download the source, and let you know if I run into any problems :)

posted by:   Nick     3-Oct-2014/18:20:45-7:00

ThanksŁ¬ David. I'll complain whatever problems I run into :p

posted by:   Rex     4-Oct-2014/3:32:36-7:00