Plugin to record voice?

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
Hello everyone!

I'm developing a videogame with RPG Maker MV to learn and practice foreign languages (Spanish for English speakers and English for Spanish speakers), where the player takes the role of a college student.

In order to do this, I designed my own university along with my teachers and classmates and you must attend all the different subjects (Grammar, Phonetics, Language, etc). The game is in a very advanced state, but I would like to improve the phonetics part.

For instance, is there a way to record audio and then play it on the game? Let`s imagine you want to practice your pronunciation, so I was thinking in an exercise where you can record your voice saying some word, then you can hear yourself on the game, and then the game plays the correct pronunciation of that word, along with showing the audio wave, so you can compare them.

Is there a way to do that? If someone can help me with this, I would appreciate it very much.

By the way, my mother language is Spanish, and I'm still an English's student so I apologize in advance for any grammar mistake.

Thank you so much!
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
RPG Maker MV voice recording would probably need to use some node.js ffmpeg stuff, but afraid so for this humble web designer, this one is out of my league.

EDIT: I googled it, and the HTML5 in RMMV can access your microphone and camera like Flash could, but I'd have to do it completely for the first time. This could be a huge learning experience for me.

EDIT/EDIT: I've played around with the camera/microphone reading functions in HTML5, and I think I might be able to make this. I've just got to do some more research.

EDIT3: I found this tutorial.
http://typedarray.org/from-microphone-to-wav-with-getusermedia-and-web-audio/
This audio buffer math boggles me. I don't want to just straight up copy this source, because the ideal audio for MV would be ogg, not wav anyway, but this audio buffer math boggles me.
Perhaps one of the pro scripters can chime in on this?

I can actually do camera pictures a whole lot easier. I already made a thing for that since you gave me the idea.
 
Last edited:

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
hi, now is depreciate, but
i use sound forge pro 11 from Sony
http://www.sonycreativesoftware.com
and don't forget vocal morphing compatible with.
From screamingbee.
https://screamingbee.com/product/download.aspx
I din`t understand very well your point. Ok, I can record voice with this... but how can I do it through RPG Maker MV? That was my question LOL


RPG Maker MV voice recording would probably need to use some node.js ffmpeg stuff, but afraid so for this humble web designer, this one is out of my league.

EDIT: I googled it, and the HTML5 in RMMV can access your microphone and camera like Flash could, but I'd have to do it completely for the first time. This could be a huge learning experience for me.

EDIT/EDIT: I've played around with the camera/microphone reading functions in HTML5, and I think I might be able to make this. I've just got to do some more research.

EDIT3: I found this tutorial.
http://typedarray.org/from-microphone-to-wav-with-getusermedia-and-web-audio/
This audio buffer math boggles me. I don't want to just straight up copy this source, because the ideal audio for MV would be ogg, not wav anyway, but this audio buffer math boggles me.
Perhaps one of the pro scripters can chime in on this?

I can actually do camera pictures a whole lot easier. I already made a thing for that since you gave me the idea.
Wow, so technically it`s possible! You always helping me, dude! Although that`s totally out of my knowledge :(

Camera pictures looks very interesting too! Can you please show me an example? I'm thinking in lot of uses for that, too.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
Here is a functional example of what can be made with RMMV.
https://webaudiodemos.appspot.com/AudioRecorder/index.html
It saves audio as wav files, but because there is a file blob, I'm assuming it's readily available for playback too with some tweaking.

The source comments link to a Github that says people can use it freely; I'd just rather write my own thing though because I'm not satisfied if I can't comprehend how it works at a web design level. After I've made a thing, I'd like to call a thing my own.

For the camera plugin, I have an example plugin awaiting moderator approval in the JS Plugin Releases forum.
I'll edit a link into this post when or if it gets approved.
 

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
Here is a functional example of what can be made with RMMV.
https://webaudiodemos.appspot.com/AudioRecorder/index.html
It saves audio as wav files, but because there is a file blob, I'm assuming it's readily available for playback too with some tweaking.

The source comments link to a Github that says people can use it freely; I'd just rather write my own thing though because I'm not satisfied if I can't comprehend how it works at a web design level. After I've made a thing, I'd like to call a thing my own.

For the camera plugin, I have an example plugin awaiting moderator approval in the JS Plugin Releases forum.
I'll edit a link into this post when or if it gets approved.
That example it`s really close to what I`m looking for! But unfortunately I don`t have any idea about how to port it to MV. :( Do you have any tutorial or any advice that could you give me to do that, please?

About the camera plugin, looks very interesting, I'll wait for the link! :D

EDIT: I found an audio player and recorder script that is exactly what I need, but only works on RPG Maker XP and VX ;_;

http://forum.chaos-project.com/index.php?topic=11778.0

The link of the demo is down, but the script code is still on the page.

Is there a way to port that code for RPG Maker MV? That`d be my only hope :blink:
 
Last edited:

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
HTML5 is little different than whatever Ruby has going on for recording, so there is no need call it a port, whatever you and I make for this.

After looking at those tutorials, it might be easier to do in MV.
I'll have a better chance at modifying the thing I posted to simply work in MV.
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
@shinichi999

I've created a plugin, but 90% is from that Github I posted. I really only implemented it for MV instead of for web pages.
So credit Matt Diamond from Github instead of me.

This video is not too good because I have no experience with dual audio-input sources in screen recording, but it sounds better than this I assure you.

This plugin has two parts.

recorderWorker.js is part of the plugin, but it goes in your game folder, so it won't show up in your plugins list.

AudioRecordAndPlay.js is the plugin.

call this by event script to record sound and play it back (not plugin command)
PHP:
ARecAndPlay.getRecording();
I took out 0.1 because of flaws. See version 0.4

Version 0.1

You'll need this in the game folder too.
 

Attachments

Last edited:

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
@shinichi999

I've created a plugin, but 90% is from that Github I posted. I really only implemented it for MV instead of for web pages.
So credit Matt Diamond from Github instead of me.

This video is not too good because I have no experience with dual audio-input sources in screen recording, but it sounds better than this I assure you.

This plugin has two parts.

recorderWorker.js is part of the plugin, but it goes in your game folder, so it won't show up in your plugins list.

AudioRecordAndPlay.js is the plugin.

call this by event script to record sound and play it back (not plugin command)
PHP:
ARecAndPlay.getRecording();
Dude, you`re amazing! I just tried to run the plugin and works perfectly!

I have two questions, is there a way to show the audio wave, as in HTML? (If not, then it`s not really important)

And second question, where is saved the audio? Or can be saved actually? In order to play it later.

Thank you very much, dude!
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
Do you mean animated buffer display like this?
Screen Shot 2017-04-23 at 6.07.07 PM.png

I've never done one before, but it's always a good time to learn a thing.

If that's what you mean, I could give it a shot.

I didn't save the audio, but I could do that too.
 

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
Do you mean animated buffer display like this?
View attachment 62756

I've never done one before, but it's always a good time to learn a thing.

If that's what you mean, I could give it a shot.

I didn't save the audio, but I could do that too.
Yeah, that`s exactly what I mean! Both things! :D

Thank you very much in advance, dude!
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
Audio buffer math boggles me and I couldn't find a tutorial, but was able to tweak an existing simple function for MV from https://github.com/cwilso/Audio-Buffer-Draw please credit Chris Wilson from Github instead of me. Once again this is another thing I could only implement into MV rather than write myself; I only tweaked the numbers to make it fit in the window.

I also forget to mention, also credit David Walsh, because I learned HTML5 getUserMedia from his tutorial. https://davidwalsh.name/browser-camera

This thing is like only 10% written by me. (as I mentioned in my first post, audio stuff is out of my league) All in all it was a great learning experience. If I were to use it, I'd study the source heavily before I could call it my own. The camera selfies plugin, that you gave me the idea for, (which is still awaiting approval) was a little smoother to write myself. Pictures and canvas stuff is more my forte.

Now it takes a filename parameter. For example to save recording in the audio/se folder "hello123.ogg". (it will overwrite any file with that name too, so watch out for that)
PHP:
ARecAndPlay.getRecording("hello123");
Then you can play it back any time in the game using event script master functions, like this...
PHP:
AudioManager.playSe({name:"hello123",pan:0,pitch:100,volume:100});
Example of recording two sound files and playing them back.

Screen Shot 2017-04-23 at 6.21.37 PM.png

Here is version 0.2

See version 0.4
 
Last edited:

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
Audio buffer math boggles me and I couldn't find a tutorial, but was able to tweak an existing simple function for MV from https://github.com/cwilso/Audio-Buffer-Draw please credit Chris Wilson from Github instead of me. Once again this is another thing I could only implement into MV rather than write myself; I only tweaked the numbers to make it fit in the window.

I also forget to mention, also credit David Walsh, because I learned HTML5 getUserMedia from his tutorial. https://davidwalsh.name/browser-camera

This thing is like only 10% written by me. (as I mentioned in my first post, audio stuff is out of my league) All in all it was a great learning experience. If I were to use it, I'd study the source heavily before I could call it my own. The camera selfies plugin, that you gave me the idea for, (which is still awaiting approval) was a little smoother to write myself. Pictures and canvas stuff is more my forte.

Now it takes a filename parameter. For example to save recording in the audio/se folder "hello123.ogg". (it will overwrite any file with that name too, so watch out for that)
PHP:
ARecAndPlay.getRecording("hello123");
Then you can play it back any time in the game using event script master functions, like this...
PHP:
AudioManager.playSe({name:"hello123",pan:0,pitch:100,volume:100});
Example of recording two sound files and playing them back.
View attachment 62759

Here is version 0.2
This is incredible and perfect! However, I`m having some problems. I can record my voice and see the wave, but when I'm going to listen it I receive the next Alert:



Although I still can listen the record and continue anyway to record the second sentence, but after that I got an alert again:



And finally the game crash with the next error:



This is what I did:



Please ignore the messages text, I wrote them really fast in order to try the plugin LOL this is really exciting!

Am I doing something wrong? I can´t find the audios after the crash, so they are not being saved by the game.

Is it possible to show the wave of the recorded audio too? For example that you could see and compare after the two waves that you recorded.

And don`t worry, everyone will be credited along with my eternal grattitude :)

Oh, by the way... about the plugin camera... I was thinking (as an option) that you could take a picture of your real face at the beginning of the game and then use it for your face character. Is that possible?

Thank you for everything again, dude!
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
It looks like it's the special characters in your folder name, and the node JS path. I have to test something. BRB.

EDIT: Yep. I've got to fix something. I'll be back in a flash.
Screen Shot 2017-04-23 at 9.42.23 PM.png
 
Last edited:

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
It looks like it's the special characters in your folder name, and the node JS path. I have to test something. BRB.
Ohhh right! My user is "Cristóbal", so probably should be that (Spanish is annoying lol)
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
Yep. I used javascript unescape which doesn't know UTF-8. I'd better use decodeURIComponent and node JS path.normalize. You are really helpful to me with debugging all my flaws. I should credit you for my plugins, for helping me learn this about UTF-8 because now I've got a bunch of old plugins with that file path to correct.

Try version 0.3.

See version 0.4
 
Last edited:

Jonforum

Veteran
Veteran
Joined
Mar 28, 2016
Messages
1,623
Reaction score
1,439
First Language
French
Primarily Uses
RMMV
Do you mean animated buffer display like this?
View attachment 62756

I've never done one before, but it's always a good time to learn a thing.

If that's what you mean, I could give it a shot.

I didn't save the audio, but I could do that too.
Very interesting with this method could have hijacked the script to make it a detector BPM.
To mix background music with beat (tempo) sync.

https://jmperezperez.com/beats-audio-api/
 

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
Yep. I used javascript unescape which doesn't know UTF-8. I'd better use decodeURIComponent and node JS path.normalize. You are really helpful to me with debugging all my flaws. I should credit you for my plugins, for helping me learn this about UTF-8 because now I've got a bunch of old plugins with that file path to correct.

Try version 0.3. (fingers crossed)
Haha I must credit you, dude, and I'll do... Now it works perfectly! :guffaw:

Do you think it is possible to develop the other things? If not, don`t worry!
 

mogwai

1984
Veteran
Joined
Jun 10, 2014
Messages
875
Reaction score
591
First Language
English
Primarily Uses
RMMV
@shinichi999
Though, there is a problem with using node.js fs to save the audio. I'm not sure it will work on phones. Perhaps one of the pro scripters can chime in on this.

@Jonforum
I'm glad you understand all that audio buffer math, because it baffles me.
 

shinichi999

Veteran
Veteran
Joined
Jul 27, 2016
Messages
134
Reaction score
15
First Language
Spanish
Primarily Uses
@shinichi999
Though, there is a problem with using node.js fs to save the audio. I'm not sure it will work on phones. Perhaps one of the pro scripters can chime in on this.

@Jonforum
I'm glad you understand all that audio buffer math, because it baffles me.
Ohh I see... I will test it... do you know if will works on Mac?
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

How many parameters is 'too many'??
Yay, now back in action Happy Christmas time, coming back!






Back in action to develop the indie game that has been long overdue... Final Fallacy. A game that keeps on giving! The development never ends as the developer thinks to be the smart cookie by coming back and beginning by saying... "Oh bother, this indie game has been long overdue..." How could one resist such? No-one c
So I was playing with filters and this looked interesting...

Versus the normal look...

Kind of gives a very different feel. :LZSexcite:
To whom ever person or persons who re-did the DS/DS+ asset packs for MV (as in, they are all 48x48, and not just x2 the pixel scale) .... THANK-YOU!!!!!!!!! XwwwwX

Forum statistics

Threads
105,849
Messages
1,016,977
Members
137,563
Latest member
cexojow
Top