Recording and Playback


#1

The functionality that @Atlante45 demo’ed at last weeks Alpha meetup has been implemented. You can now record your avatar movement and voice and play it back.

To do this:

Open up your script editor and copy in the following code.

   // Key '>' will start a recording . Key '<' will stop a recording. Key '?' will load the last recording.     
Controller.keyPressEvent.connect(function(event) {
    if(event.text == ">") {
        MyAvatar.startRecording();
    } else if(event.text == "<") {
        MyAvatar.stopRecording();
    } else if(event.text == "?") {
        MyAvatar.loadLastRecording();
        MyAvatar.startPlaying();
    }  
});

As this feature expands, imagine being able to build out a full set of AI using your recorded animations and audio…

http://cdn.arwrath.com/1/187698.gif

Limitations

The recording is currently not saved, yet we will add this functionality is future releases.


#2

Sweet, that demo was awesome too. Ideas started popping into my head right away. It will be a useful tool in many ways. A greeter bot could welcome someone to a location, it would also be great for tutorials and such, any situation where you want the action done repetitively.

Some ideas for additional functionality would be the ability to edit a recording, and looping a recording would be useful too, although that could easily be done via scripting.


#3

Tested on Windows version of interface.exe, doesn’t appear to be working. I’m not sure if there should be an indication that recording has started or stopped, but didn’t get one if there is, and no playback when hitting R.


#4

Hi @John_Laury at the moment there is no GUI. I tested on Windows 7 and everything worked. On the console screen you should see “startrecording”.


#5

Hitting CTRL+R to start recording… hitting CTRL+R again, to stop, hitting R key to playback. Hitting R to playback, no playback, no indication of recording in the console window, I pulled the log and searched it, no messages indicating saying startrecording or start recording.

I detached all scripts in case I was getting interference from another script grabbing key presses, still not working, @Judas saying he’s unable to get it to work either.

Running Win 7 Ultimate, 64 bit


#7

@John_Laury looks like it broke between build 1000 and 1006. I will let @Atlante45 know.


#8

I just spoke with @Atlante45. He took it out to enable the ability to for controls through scripting. He is still writing the .js script, yet the functions are available if you want to quickly write your own.

Look at this :https://github.com/highfidelity/hifi/blob/master/interface/src/avatar/MyAvatar.h
Starting at line 172

bool isRecording();
void startRecording();
void stopRecording();
void saveRecording(QString filename);

bool isPlaying();
void loadRecording(QString filename);
void loadLastRecording();
void startPlaying();
void stopPlaying();

Therefore in js you could call myavatar.startrecording() to start etc etc.

Chris


#9

Here is an example script. Drop this into your script editor.

   // Key '>' will start a recording . Key '<' will stop a recording. Key '?' will load the last recording.     
Controller.keyPressEvent.connect(function(event) {
    if(event.text == ">") {
        MyAvatar.startRecording();
    } else if(event.text == "<") {
        MyAvatar.stopRecording();
    } else if(event.text == "?") {
        MyAvatar.loadLastRecording();
        MyAvatar.startPlaying();
    }  
});

#10

yeah sorry guys, I forgot I had removed the keybindings on my latest PR.
Script coming soon.


#11

No problem, I just was wondering because it was announced as working so I was testing it, but if you took it down (the key bindings), no problem. I’ll try it out via scripting for now. @chris … yeah, I saw those browsing the MyAvatar code the other day.


#12

For those that can’t wait :wink:

Here is a rough functional version of the script

Icons signification:

  1. start/stop recording
  2. play
  3. save
  4. load
  5. load last recording

By default it saves and loads to a file called recording.rec int the interface Resources folder.


#13

Ok, since @Atlante45 did such a great job doing all the under the hood work to put in the recording feature, I decided to take a stab at a GUI control for it…

I think it came out pretty well, I tried to match the interface with the controls as close as possible. I think it came out pretty well.

edit…lol, looks like @Atlante45 beat me to it… I’ll change my script to use the icons he provided.


#14

Nice work @John_Laury !

It’s not done yet, I have my first PR though with UI a little bit more polished.
Just need to update the URL and upload the icons on S3.


#15

Just posted 2 screenshots of the final (for now at least) UI of the script I wrote on the random picture thread.
You can see them here.

The PR is here for those interested. You can pull and check it out by yourself if you know how.
Otherwise, this should be merged shortly.


#16

Ok, the PR just got merged. The script name is “Recorder.js”, you can find it in running script.


#17

@Atlante45 great job! @judas @John_Laury would love to get some feedback on this. It would also be great to link to any recordings you do (the recorded file). I like the idea of an “Interactive Machinima” where someone else could run your recording and experience something you did.


#18

Hey well its working its got almost endless possibilities.

@Atlante45 @chris I’m having a problem with the sound recording intermittently, tried it in the alpha and my own domain.Im on a pc
My sounds been great over voice recently so it seems like a new lil quirk

My thoughts on it, one I just had was this
Remember when we had a bug where avatars remained after they logged out. Could we use that but so when u stop recording your avatar ghosts and you kinda step out of your body leaving a ghost there doing its thing.

I’m running a stack manager is their any way to plug my mic straight into my audio stack?


#19

Hi @Judas when you are on your stackmanager your audio is going direct. You can also go into your Stack Manager settings http://localhost:40100/settings/ and enable Jitter Buffer.

Other than that, maybe @Atlante45 has some ideas.


#20

Checked ma server and the jitter bug is on, tried it in the sandbox also. its clear as a bell till it drops out. I messed with my volume levels and that doesn’t seem to effect it.
Is the sound being recorded to my pc in the file it creates or sent elsewhere?


#21

I’m getting that intermittent audio issue to in both my domain and alpha.highfidelity.io as well. I went in and changed the jitter buffer to 10 (as @chris had me do the other day on my client).

It’s funny, it’s 2014, and @chris posted that movie trailer from 1995 about a way to play back someone else’s thoughts into your own head… I guess the old saying “There’s nothing new under the sun is true…”