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

0 Members and 1 Guest are viewing this topic.

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #15 on: July 30, 2013, 11:09:48 AM »
That would obviously be more difficult. Baby steps.

Kalle

  • $upporter
  • Hero Member
  • *****
  • Posts: 2320
  • Karma: 47
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #16 on: July 30, 2013, 11:12:59 AM »
Quote
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. 


If I understand you correct, there is no problem to create a command with a logic block to have comments like "this is a great song" or similar, particular when you use media monkey. There is in the basic VC installation for MediaMonkey a command available "what rating" (I think so) and if you edit this command - put a logic block in with IF (AcontainsB OR A==B) with {LastResult} for A and 100 as B THEN TTS.Speak - this is a great song | my favorite song | top hit ...

and you can insert for each rating (0, 10, 20 ... 100) a logic block

you can also edit the MediaMonkey ini file and insert a custom column (with comments) to use it in VC as result.
***********  get excited and make things  **********

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #17 on: July 30, 2013, 12:02:37 PM »
PS: Loving MAPS, especially the set command, this will be useful.

Slightly misunderstanding me.   I want a database of .wav files associated to specific tracks with the option of more than one .wav per track. 

When a track plays, the .wav is triggered, playing a brief interlude saying what ever had been previously recorded by the end-user. 

EG: Nine Inch Nails is playing, you ask to leave an audio comment (review, sting).  The system records your quick comment "Man I love this band, they are great".  Next time that band plays, the comment is then played back to you over top of the beginning of the music.  Some times there are going to be more than one comment per artist hence the "nine inch nails*.wav"

I've all ready found good use for the MAPS tables.  I have a lot of play-lists that use the same shuffled randomised TTS responses, I like to add variety of responses, the MAPS function allows me change it all in one place while applying global effect, very useful. 




thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #18 on: July 30, 2013, 12:08:10 PM »
Quote
[put a logic block in with IF (AcontainsB OR A==B) with {LastResult} for A and 100 as B THEN TTS.Speak - this is a great song | my favorite song | top hit ...

and you can insert for each rating (0, 10, 20 ... 100) a logic block

What you suggested here has just given me a good idea.  I wanted the TTS to say "Another 90s classic" and I can see if {item.genre} is less than 2000 say "Another 90s classic" for example.  Very cool.  
« Last Edit: July 30, 2013, 07:31:13 PM by jitterjames »

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #19 on: July 30, 2013, 07:34:53 PM »
Some times there are going to be more than one comment per artist hence the "nine inch nails*.wav"

You should be able to use the action:
Code: [Select]
File.GetRandFile

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #20 on: July 30, 2013, 10:28:54 PM »
I do not know how I missed this, this is brilliant. 

Okay so all I need to do is find a way to extrapulate the full path of the 'currently playing' audo-event, send this path to the TCPwav plugin.  Then when playing back audio, use the same path and insclude the wildcard {item.title}*.wav

Okay.  You would be better at this than me, but I'll have a look..

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #21 on: July 30, 2013, 11:06:40 PM »
I do not know how I missed this, this is brilliant. 

Okay so all I need to do is find a way to extrapulate the full path of the 'currently playing' audo-event, send this path to the TCPwav plugin.  Then when playing back audio, use the same path and insclude the wildcard {item.title}*.wav

Okay.  You would be better at this than me, but I'll have a look..

I think that's usually the case with voxcommando but that doesn't mean that I'm going to do everyone's work for them :-)

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #22 on: July 30, 2013, 11:09:36 PM »
Okay I've done it, but I've hit a snag that is going to require your skills.  

It appears that the .wav files that are saved from TCPmic are in fact not compatible with 'Sound.PlayWav' command.  

I'll show you what I've done anyway, I could get a batch converter to run in the background if this can't be resolved but would rather not.  

This one is to catch the review, it obtains the bands 'artist' name and appends it to a file, which is then saved in the Reviews folder:

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="False" name="Bubbles" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="993" 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>
  <command id="977" name="Reviews" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.Raw</cmdType>
      <cmdString>Player.GetItem&amp;&amp;"playerid":0, "properties": ["title", "album", "artist", "rating","playcount","genre"]</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.ParseTokens</cmdType>
      <cmdString>{item.artist[[, also, ]]}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>TcpMic.SaveNext</cmdType>
      <cmdString>Z:\Library\Reviews\{LastResult}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <xref optional="true">C:\Users\Production\Desktop\VocCommando old\phrase database\introduction.xml</xref>
    <xref optional="true">C:\Users\Production\Desktop\VocCommando old\phrase database\query.xml</xref>
    <phrase optional="true">post, leave, give, say, tell, say what I</phrase>
    <phrase optional="true">my, a, some</phrase>
    <phrase>review, reviews, comment, comments, commentary, think, say, thoughts, opinions, something </phrase>
    <phrase optional="true">about this, about the, on this, on the</phrase>
    <phrase optional="true">track, song, single, band, group, artist, album, podcast, programme, show, series</phrase>
    <xref optional="true">C:\Users\Production\Desktop\VocCommando old\phrase database\manners.xml</xref>
  </command>
</commandGroup>

We can then request a review, I will add to this, throw in some sweepers at the beginning and ending and maybe introduce some processing of the .wav to cleanup background noise.   The cool thing is is that it will play a random review of what ever band you are playing, right now I just do it for artist rather than song because I simply don't want to have to do a review for every song just to prove the concept.  

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<commandGroup open="False" name="Play Bubbles" enabled="True" prefix="" priority="0" requiredProcess="" description="">
  <command id="996" name="play bubbles" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
    <action>
      <cmdType>XJson.SoftMute</cmdType>
      <cmdString>80</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.Raw</cmdType>
      <cmdString>Player.GetItem&amp;&amp;"playerid":0, "properties": ["title", "album", "artist", "rating","playcount","genre"]</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.ParseTokens</cmdType>
      <cmdString>{item.artist[[, also, ]]}</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>File.GetRandFile</cmdType>
      <cmdString>Z:\Library\Reviews\&amp;&amp;{LastResult}*.*</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>Sound.PlayWav</cmdType>
      <cmdString>{LastResult}&amp;&amp;True</cmdString>
      <cmdRepeat>1</cmdRepeat>
    </action>
    <action>
      <cmdType>XJson.SoftUnMute</cmdType>
      <cmdString />
      <cmdRepeat>1</cmdRepeat>
    </action>
    <xref optional="true">C:\Users\Production\Desktop\VocCommando old\phrase database\introduction.xml</xref>
    <xref optional="true">C:\Users\Production\Desktop\VocCommando old\phrase database\query.xml</xref>
    <phrase optional="true">listen to, play me, play us, play, give me</phrase>
    <phrase optional="true">a, some</phrase>
    <phrase>review, reviews, comment, comments, commentary, think, say, thoughts, opinions, something, bubble, bubbles </phrase>
    <phrase>about this, about the, on this, on the</phrase>
    <phrase>track, song, single, band, group, artist, album, podcast, programme, show, series</phrase>
    <xref optional="true">C:\Users\Production\Desktop\VocCommando old\phrase database\manners.xml</xref>
  </command>
</commandGroup>

So yeah James, can we fix this issue with VoxCommando now being able to load the .wav.  I have attached a wave so you can test it for yourself.  

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #23 on: July 30, 2013, 11:12:05 PM »
Quite proud of myself :)  I'm starting to understand this stuff :D

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Save the audio file from VoxWav to a custom folder.
« Reply #24 on: July 30, 2013, 11:16:36 PM »
Yeah, looks like you are moving right along.

It's past my bed time so I won't be able to really read your post and look at your actions etc.

I don't know what is up with the wav.  Maybe I am breaking some unwritten (or maybe just unread) law of wavs when I recreate it from the audio stream sent by voxWav.  In any case I think you can play it by using another action:

Sound.PlayStream

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #25 on: July 30, 2013, 11:36:39 PM »
Hahah yes it works...  PlayStream ah.  Does that include the <wait> variable.  I hope so.  Thanks James. 

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #26 on: July 31, 2013, 12:33:11 AM »
YUS!!! It all works so brilliantly.  Leaving reviews and then listening to them is soo soo cool..

Best of all I'm going to introduce Stings next.  Very happy. 

What I seem to have noticed is the long .wav files work fine, it's the short ones.  Odd.. I will look further in to this..

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #27 on: July 31, 2013, 10:25:26 PM »
Now for the next iteration of my master plan.  I am trying to integrate command-line audio processing of the wavs once recorded.  Now this is not hard obviously but what I've discovered is that the .wav files that voxcommando is creating is not being accepted by the specific software I am utilizing. 

The software I'm utilizing is called MrsWatson. http://teragonaudio.com/MrsWatson.html.  Quite frankly a brilliant little program which allows for some very quick and useful background signal processing.  It allows integration of audio VST technology so i'm able to apply a whole host of processes to the .wav files that are produced. 

This is useful for such things as normalization of audio, removal and gating of back-ground noise, multi-band compression, exciters and other audio enhancements.  Essentially we can bring the .wavs to life and make them sound clear and punchy. 

This is obviously great for what I'm doing but also for other applications such as sending audio emails to loved ones, relaying audio messages with-in your household, incoming and outgoing phone communications etc. 

So yeah, I'll try and find a separate batch .wav converter to try and resolve these funny .wav outputs we are having here but if we could look into this at some point that would be great, I'm sure this work will come in useful for other members other than myself.   

What do you all think?  Little hung-over so hopefully I'm making sense. 

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #28 on: August 01, 2013, 02:18:46 AM »
Okay the TcpMic plugin needs to transfer over a {LastResult} or other such variable when acting on the WavSaved event. 

I am using SoX to process my waves, it does a great job of compression, removing silence between pauses and noise reduction.  But I am unable to get VoxCommando to process the wav once it's saved.  Demonstrate as follows.

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<command id="546" name="Process Audio Event" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>VC.Pause</cmdType>
    <cmdString>1200</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Launch.RawParam</cmdType>
    <cmdString>C:\Program Files (x86)\sox-14-4-1\sox.exe&amp;&amp;"{LastResult}" "{LastResult}.process.wav" silence 1 0.1 0.2% -1 0.5 0.2% contrast 75</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>OSD.ShowText</cmdType>
    <cmdString>{LastResult}</cmdString>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <event>TcpMic.WavSaved</event>
</command>

I am so close to having automated processing of assigned audio events..  Can you give me some insight to this James.  I will look into using eventghost if possible, I don't think it will work though. 

thesystemera

  • $upporter
  • Sr. Member
  • *****
  • Posts: 125
  • Karma: 0
    • View Profile
Re: Save the audio file from VoxWav to a custom folder.
« Reply #29 on: August 01, 2013, 04:15:56 AM »
Decided to batch process it, still having strange issues though, does any one know anythign about batch processing, am I missing something here?

Can someone tell me why this is not working. It is not honouring the -1 and therefor not removing middle silence. When I try command line on an individual file it is fine but when trying to do batch I have no luck.. It’s honouring the 1 and any other commands I’ve toyed with, it’s like the “-” from the “-1″ is disappearing???

cd C:\Program Files (x86)\sox-14-4-1
for /f “tokens=1-2 delims=.” %%i in (‘dir /b z:\library\reviews\processing\*.wav’) do (sox.exe “z:\library\reviews\processing\%%i.wav” “z:\library\reviews\%%i.wav” silence 1 0.1 0.2% -1 0.5 0.2%)