Author Topic: Save the audio file from VoxWav to a custom folder.  (Read 20633 times)

0 Members and 1 Guest are viewing this topic.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Save the audio file from VoxWav to a custom folder.
« on: May 06, 2013, 11:18:30 AM »
I want to be able to speak a command to VoxCommando that triggers VoxWav to save the next audio event it gets..

Basically. I say start recording or "shoutout" and then the next time I press the button it saves that recording to a custom folder. Worth noting that the speech recognition would have to be temporarily disabled as to not interrupt with the system. 

The custom folder is an active smartplaylist in XBMC so my recording is then played back to me moments later amongst my music and podcasts :D

Cool huh :D

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #1 on: May 06, 2013, 12:31:18 PM »
save the next audio event it gets..

What do you mean by this part?

Quote
the next time I press the button
the button?

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #2 on: May 06, 2013, 09:09:18 PM »
I somehow missed that you were talking about VoxWav, so now it makes more sense to me.  :biglaugh

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #3 on: May 06, 2013, 10:08:56 PM »
I could probably modify the tcpmic plugin to allow for this. Would you want to specify the full path with filename, or just the folder and have the filename be generated / incremented automatically?

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #4 on: May 07, 2013, 01:24:06 AM »
Folder and filename.  Filename will need a date/time stamp or something like that.  Basically the idea is that I test this between two XBMC's with a shared library, I am able to relay the messages between computers in correct order between the music and podcasts.. 

For a home system that's pretty cool, a kind of intercom inside your home.  "Honey can you find my socks" she's in the kitchen hears the message between the songs.  You'd have to have a pretty big house for that right, not to actually hear.  Better one "Kids go to bed!" ahahah

I'll post you more detail about I'm doing here.  Thanks James. 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #5 on: May 07, 2013, 02:18:31 PM »
OK done.

Update the tcpmic plugin with the attached files and restart VC.

import the following group for testing:
Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="True" name="voxwav save next wav" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="923" name="save next wav" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>TcpMic.SaveNext</cmdType>
      <cmdString>savenexttest.wav</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <phrase>save next wav</phrase>
  </command>
  <command id="924" name="play the wav" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>Sound.PlayWav</cmdType>
      <cmdString>{1}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <event>TcpMic.WavSaved</event>
  </command>
</commandGroup>

The sample command will play back your wav file immediately after saving it.  You'll have to figure out how to work this into your XBMC scenario though.  I'm not sure how you are going to do that.
« Last Edit: March 31, 2015, 05:02:55 PM by nime5ter »

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #6 on: May 08, 2013, 03:56:13 AM »
Does not seem to be working, where does it save the .wav to.  I tried specifying a directory in the only parameter box I could see with no luck. 

Just to be clear.  What I"m trying to do is quite neat.  I activate the command by saying "shoutout" then the next time I activate the plug-in, what ever I say is recorded and then shipped off to a folder for XBMC to then pick-up and import into a playlist. 

On that note.  This is my other small issue.  The .wav needs to contain title and genre details as to allow XBMC to recognise it in 'library mode'.  The file also needs to be timestamped or something to allow it to not clash with other files.

If you had the time, the best thing would be to allow a custom name such as "lounge-01" with a custom Title and Genre heading able to be applied.  This way the TTS can read out who made the .wav and I can use the genre field to filter out the style of the response from the TTS. 

This will be very cool on a household with multiple XBMC's but also it allows me to crudely demonstrate the 'shoutout' concept of hushfm

PS:  Should move this to Google+ Communities.  Everyone is going to wonder what I'm going on about LOL and it's much easier to search and keep track of these conversations..

 

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #7 on: May 08, 2013, 04:01:35 AM »
PS: I found the wavs..  I think it wasn't working because I temporarily actived 'detect silence'.   My bad.  Still though need to find a way to stamp them with a title and genre.  Is there any batch style commands or programs you know that can apply such changes to a file or many files at once. 

Thanks..

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #8 on: May 08, 2013, 04:20:46 AM »
No something weird is going on..  It won't let me save more than one directory tree from root. 

example: z:\library\shoutout\test.wav

saves the files z:\library\shoutouttest2013_5_8_19_19

Any ideas, not a biggy at the moment as stated I still need to address the file details issue any way, thing is it is working D


jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #9 on: May 08, 2013, 08:04:44 AM »
No something weird is going on..  It won't let me save more than one directory tree from root. 

example: z:\library\shoutout\test.wav

saves the files z:\library\shoutouttest2013_5_8_19_19

Any ideas, not a biggy at the moment as stated I still need to address the file details issue any way, thing is it is working D



Sorry, Iooks like I forgot to add a backslash.  I only tested saving with just a filename, which puts it in the VC folder. Easy to fix.

Adding meta tags will be much more difficult.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #10 on: May 08, 2013, 11:56:46 AM »
I fixed the path problem.
« Last Edit: March 31, 2015, 05:03:45 PM by nime5ter »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #11 on: May 08, 2013, 11:58:11 AM »
This will insert the wav into the xbmc playlist immediately after the currently playing song.

You need to have the python plugin enabled, simply so we can add 1 to a number!

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="924" name="play the wav" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>Sound.PlayWav</cmdType>
    <cmdString>{1}</cmdString>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>Player.GetProperties&amp;&amp;"playerid":0, "properties":["percentage","playlistid", "position","time","totaltime"]</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.ParseTokens</cmdType>
    <cmdString>{position}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>PY.ExecString</cmdType>
    <cmdString>result = {lastresult}+1</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw/</cmdType>
    <cmdString>Playlist.Insert&amp;&amp;"playlistid": 0, "item": {"file": "{1}"}, "position":{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>XJson.Raw</cmdType>
    <cmdString>GUI.ActivateWindow&amp;&amp;"window": "musicplaylist"</cmdString>
    <cmdRepeat>0</cmdRepeat>
  </action>
  <event>TcpMic.WavSaved</event>
</command>

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #12 on: July 30, 2013, 10:35:50 AM »
Hey James I've got an idea, I'm wondering with the current modifications of the TCPmic would it be doable. 

In a nutshell. A bit like 'shoutouts' I'm thinking about the 'bubbles' concept in regards to tracks. 

As I explain in the video.  'bubbles' are like review, comments, notes that people can attach to any audio event that is currently playing, allowing for other users to then listen to that audio event at a later date. 

There's no point for me implementing this for songs as I can't be bothered reviewing each and every song in my POC database but doing it for the band in general would be cool as I only have a handful of bands. 

So is there a way I can get the TCPmic save wav function to save the wav with the bands name included, so as to then allow retrieval of that specific file when the band plays again.  On top of that can I use a random wildcard situation if there are multiple files saved for a specific band. 

EG: retrieve any file from Z:/library/bubbles/{last.resault}*.wav

The whole idea is I can use short reviews like stings, so when a song start playing you have a sting play at the intro of the song alongside the TTS voice "Wow I love this band, they are great" example and I can use longer recordings as actual reviews...So as to when you request a review for example. 

Any way, thoughts?

I know it's just a POC, but the more realistic it is, essentially the better it is as a tool when utilising talent, programmers and potential funding.  Also is going to make the killer home media system when I implement video :D

Thanks James. 

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #13 on: July 30, 2013, 10:59:20 AM »
You can use maps.  Did you see the intro video for maps?

When you save the wav file you can ask XBMC for the artist id, then store the id and filename in maps using the artist id as the key.

Later when a new song comes on, you can use maps to find the wav filename.

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #14 on: July 30, 2013, 11:06:47 AM »
Okay, what about randomisation of extension in cases of more than one file?  I will hunt down this video your talking about..