Author Topic: audio xml  (Read 3359 times)

0 Members and 1 Guest are viewing this topic.

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
audio xml
« on: May 13, 2016, 02:47:57 AM »
Good day (morning or evening night)
There is a question for you?
How do you know when you create peyloud
for example in Kodi or i tuns
Audio peyloud contains the name of the songs in English language
and vc I use Russian.
here is the question.
How to convert peyloud phrase from English  into Russian?
Perhaps in due vox or Python?
about to be something (as I understand)
Results.RegExReplace  R->р
Results.RegExReplace  t->т

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: audio xml
« Reply #1 on: May 13, 2016, 09:06:13 AM »
It will not be easy. Even if you can do it I don't think it will work very well. Can you give an example of a payloadXML file to translate?

If you are talking about actual English words I don't think just changing the letters to Cyrillic will result in a word that will be recognised.

I think you would be better off using an English speech engine, even if you have a strong accent.

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: audio xml
« Reply #2 on: May 13, 2016, 09:12:58 AM »
As an example, consider the Beatles song "Strawberry Fields Forever"

How would you transform that into Cyrillic characters?
« Last Edit: May 13, 2016, 12:12:51 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: audio xml
« Reply #3 on: May 13, 2016, 01:14:22 PM »
Strawberry Fields Forever == стровберри филдс форевер

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: audio xml
« Reply #4 on: May 13, 2016, 01:21:09 PM »
Code: [Select]
#
import re
import os
from re import findall
from xml.etree import ElementTree as ET

# Set the directories and files
rootDir = "E:\\Videos"
xmlpath = "E:\\Appz\\Vox\\payloads\\videos.xml"
txtfile = open("E:\\Appz\\Vox\\payloads\\videos_list.txt", "wb")

#function: get rid of unwanted characters
def cfix(zx):
    global x
    f2 = re.sub( '\s+', ' ', zx).strip()
    f2 = f2.replace(" -", " ")
    f2 = f2.replace("- ", " ")
    f2 = f2.replace(" - ", " ")
    f2 = f2.replace("-", " ")
    f2 = f2.replace(":", " ")
    f2 = f2.replace("_", " ")
    f2 = f2.replace("5.1", "")
    f2 = f2.replace(".", " ")
    f2 = f2.replace("!", " ")
    f2 = f2.replace("1080p", " ")
    f2 = f2.replace("720p", " ")
    f2 = f2.replace("x264", " ")
    f2 = f2.replace("ac3", " ")
    f2 = f2.replace("AC3", " ")
    f2 = f2.replace("DTS", " ")
    f2 = f2.replace("DVD", " ")
    f2 = f2.replace("DvD", " ")
    f2 = f2.replace("VOB", " ")
    f2 = f2.replace("rip", " ")
    f2 = f2.replace("aac", " ")
    f2 = f2.replace("Rip", " ")
    f2 = f2.replace("hd", " ")
    f2 = f2.replace("HD", " ")
    f2 = f2.replace("Hd", " ")
    f2 = f2.replace("Hq", " ")
    f2 = f2.replace("(", " ")
    f2 = f2.replace(")", " ")
    f2 = f2.replace("]", " ")
    f2 = f2.replace("[", " ")
    f2 = re.sub( '\s+', ' ', f2).strip()
    x = f2
    return x

#create the root </PayloadsRoot> <PayloadsRoot>
root_element = ET.Element("PayloadsRoot")

for dirName, subdirList, fileList in os.walk(rootDir):
    for fname in fileList:
        #create the first subelemet <payload> </payload>
        pay_element = ET.SubElement(root_element, "payload")
        #create the first child <value> </value>
        child = ET.SubElement(pay_element, "value")
        child.text = dirName +"\\" + fname
        #create the second child <phrase> </phrase>
        child = ET.Element("phrase")
        #get the filename without the extension
        fname = ('.').join(fname.split('.')[:-1])
        #UnicodeEncodeError: 'ascii' codec can't encode character
        fname.encode('ascii', 'ignore')
        #get rid of unwanted characters
        cfix(fname)
        fileName = x
        #print(fileName)
        txtfile.write(str(fileName) + "\n")
        child.text = fileName
        #now append
        pay_element.append(child)
txtfile.close()

def indent(elem, level=0):
    i = "\n" + level*'\t'
    if len(elem):
        if not elem.text or not elem.text.strip():
            elem.text = i + '\t'
        if not elem.tail or not elem.tail.strip():
            elem.tail = i
        for elem in elem:
            indent(elem, level+1)
        if not elem.tail or not elem.tail.strip():
            elem.tail = i
    else:
        if level and (not elem.tail or not elem.tail.strip()):
            elem.tail = i

indent(root_element)
#View xml tree
#print ( ET.tostring(root_element) )

output_file = open(xmlpath, 'w' )
output_file.write( '<?xml version="1.0" encoding="utf-8"?>'+'\n' )
output_file.write( '<!--A VoxCommando Payload file-->' +'\n' )
output_file.write( ET.tostring(root_element) )
output_file.close()

I have done on the basis of this code, but do not understand how to read from peyloud.
Leave the path untouched and translated phrase.
I myself can finish the translation. I do not understand the command.
I understand that the translation will have to get out of the curve but
And how do you propose to use the 2 voice engine?
that I do not understand how for example to switch from 1 to another
« Last Edit: May 13, 2016, 01:43:02 PM by mr.niki »

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: audio xml
« Reply #5 on: May 13, 2016, 01:30:22 PM »
An opportunity you tell the other option?
ituns or other program in the preparation of peyloud
take the information from the file. how to make sure that they take the information
As of Fail named folder and not from the "File of the body."
While Fail named folder, and so will be generated in terms peyloud
« Last Edit: May 13, 2016, 01:32:37 PM by mr.niki »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: audio xml
« Reply #6 on: May 13, 2016, 01:32:35 PM »
But I think you do not understand English pronunciation. You cannot use the same rules each time, automatically.

It will not be a consistent, one-to-one transformation from an English letter to a Russian letter.

In this case:
S == c
T == т
R == р
A == о *PROBLEM 1
W==в *PROBLEM 2

B == б
E == е *PROBLEM 3
R == р
R== р
Y = и *PROBLEM 4

F == ф
I == и *SEE PROBLEM 4
E == MISSING? --> THIS IS PROBLEM 5
L == л
D == д
S ==с PROBLEM 6 (What happens when the English word is "Russian" or "season" ? In these cases, "s" is not always a "с" sound)

etc.

Of course, it is possible for a human being to look at a word and determine a phonetic transcription. But that is not the same thing.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: audio xml
« Reply #7 on: May 13, 2016, 01:35:45 PM »
yes there is a problem
but anyway)

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: audio xml
« Reply #8 on: May 13, 2016, 01:38:30 PM »
I now use this command to music but I do not like what I download vc

and the fact that after 1 songs is randomly playback. well it works
« Last Edit: May 14, 2016, 01:20:30 AM by mr.niki »

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: audio xml
« Reply #9 on: May 13, 2016, 01:46:32 PM »
And how do you propose to use the 2 voice engine?

Download an English SP language engine.

Have 2 separate VC configurations. Run them both at the same time.
(There is a special trick to do this: http://voxcommando.com/mediawiki/index.php?title=Command_line#Allow_a_second_instance_of_VoxCommando_to_run_simultaneously -- look at the screenshot on this page)

Use a basic English configuration only for the English commands that you need. Use the tools that VC provides (e.g. Prefix mode) so that each VoxCommando version only responds to its own command phrases and not the commands for the other version.
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: audio xml
« Reply #10 on: May 13, 2016, 02:12:08 PM »
I ran 2 vc
I did not understand only one thing
2 vc (en) should send messages while 1(ru)? if so, how (for example the team)
VoxCommando.exe -port "message string"  ????
or 2 vc must be independent
how to do it better

nime5ter

  • Administrator
  • Hero Member
  • *****
  • Posts: 2012
  • Karma: 61
    • View Profile
    • Getting Started with VoxCommando
Re: audio xml
« Reply #11 on: May 13, 2016, 07:56:24 PM »
VoxCommando.exe -port "message string"  ????

No, like the screenshot in the top right corner of that wiki page, you just need:
Code: [Select]
VoxCommando.exe -New
The command line parameter "-new" is needed if you want to run 2 different VCs at the same time. However, the two versions do not need to communicate at all.

You will have to use some simple English-language commands in the English version in order to play English songs. You will have to set the confidence levels quite low in the English configuration, because of your Russian accent.

The first step is to test whether the English speech recognition engine can understand you at all, if you try to say English commands.

If it works, then you can worry about setting up the 2 versions of VC to run simultaneously. Otherwise, there is no point.

The problem of English song titles has been discussed on the forum a lot. There is no perfect solution, unfortunately.

Here, Kalle demonstrates how he uses 2 different VoxCommando configurations simultaneously. One is German, the other is English (see ~5:22, half way through the video):

« Last Edit: May 13, 2016, 10:34:06 PM by nime5ter »
TIPS: POST VC VERSION #. Explain what you want VC to do. Say what you've tried & what happened, or post a video demo. Attach VC log. Link to instructions followed.  Post your command (xml)

mr.niki

  • Contributor
  • ***
  • Posts: 84
  • Karma: 1
    • View Profile
Re: audio xml
« Reply #12 on: May 15, 2016, 09:12:39 AM »
dear jitterjames
Are you in the next versions of the program to add a function
I will try to describe it properly.
Now the function Steam voleum also reduces the volume of the TTS Plugin
Can you make sure that they do not depend on?
For example, I listen to the radio on the volume of 20%
and TTS plugin reported while the volume of 100%

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7715
  • Karma: 116
    • View Profile
    • VoxCommando
Re: audio xml
« Reply #13 on: May 15, 2016, 11:15:38 AM »
dear jitterjames
Are you in the next versions of the program to add a function
I will try to describe it properly.
Now the function Steam voleum also reduces the volume of the TTS Plugin
Can you make sure that they do not depend on?
For example, I listen to the radio on the volume of 20%
and TTS plugin reported while the volume of 100%

You should create a new thread when asking a new question. This is a completely new topic.

What you are requesting is actually not possible.  I recommend you use one of the large number of (free) media playback programs available, which VoxCommando can control, in order to play your audio streams.  Then you will be able to control the audio volume independently from the TTS volume.