IPB

Welcome Guest ( Log In | Register )

3 Pages V   1 2 3 >  
Reply to this topicStart new topic
foo_talktome, A remake of foo_tts for text-to-speech title/artist on track change
aganders3
post Jun 15 2010, 19:58
Post #1





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



Hello! I've just finished coding a working version of my first plugin, foo_talktome. I wanted a plugin to read the title and artist of each track that played, because I often listen to music on my wireless headphones. When I listen to my whole library or a group of new albums on random, this helps me remember who/what I liked. Hopefully others will enjoy this too!

Before writing this I checked if it existed already, and I found foo_tts, written by paulski. It seemed development on that had stopped, however, and there were even requests for a new version, so I went ahead with my little project. Hopefully I'm not stepping on any other devs' toes with this!

Download foo_talktome.dll v1.0 here
(or here)
(These links should be up-to-date)

Just put the dll in the Components directory and it should add a menu option (under Playback) to turn it off/on.

Please use the issue tracker on the BitBucket Repo to report bugs/feature requests.

--------------------------------------------------
Update! Version 1.0 released May 7, 20122013 (That's a long time between updates.)

Thanks to danthe0 some major unicode-related bugs have been addressed. Now you should be able to get this working with Asian characters/voices. I am also now building with the latest SDK version, so you will need Foobar2000 v1.1 to use this component (sorry! if you need/want an older version please let me know - I may have it). Thanks to everyone who uses this component, and especially those of you who contribute feedback, bug reports, and even code! To celebrate these major changes/improvements, I am bumping the version number to 1.0.

Along with this new version, I am officially announcing the code as open source. The source has been up for a while, but I just realized I never made that announcement here.

Finally, my use of this plugin has diminished, hence the slowdown in development. I know there is another TTS plugin out now, and it seems to have some really cool features. However, I am happy to keep working on this if there is still interest in foo_talktome. I am also interested in helping/working with other developers to create TTS or other interesting Foobar components - just PM me if you'd like to work together on something.

--------------------------------------------------
Update! September 7, 2011

Hey everyone. I'm glad people are still getting use out of this plugin! I halted development for a while because things seemed to be working pretty well, but I know there are some serious bugs out there still. In order to keep up with everything, I'd like to move development and issue tracking over to my Bitbucket repository:

https://bitbucket.org/aganders3/foo_talktome

There is a public wiki and issue tracker there, and you don't need an account to post on the issue tracker (though it's better if you make one). I've added a few issues/feature requests from this thread to the system there, but I'm sure I missed quite a few. If you have an issue or feature request, please add it on the Bitbucket issue tracker.

This is also my first step toward releasing the source code for this plugin, just so the project can live on even if I become too busy to maintain it. I'm not quite ready to do that, though, as I'm still a bit shy about my coding abilities.

--------------------------------------------------
June 22, 2010 - OK, it took some playing around, but the new version seems to be working!

Download foo_talktome v0.4

(Hopefully) Fixed in this version:
* No more dll dependencies, everything should be statically linked (Still figuring out dependency walker, but I hope it's working)
* Remembers the state on shutdown

Thanks again to everyone who has downloaded or shown interest in my plugin! This has been a great learning experience for me so far.


--------------------------------------------------
June 28, 2010 - A new version is released!

Download foo_talktome v0.5

New features:
* A preferences pane!
* You decide the speech formatting (uses built-in Foobar2000 title formatting strings)
* An option to pause playback while speaking

I also tried to fix the 0 volume bug that was brought up. I was never able to reproduce it, though, so I'm not sure the changes worked. I've taken note of the other suggestions in this thread (volume fading when speaking, announcing at the end of the song...), and I will try to work on them over time, but implementation of some of them is not quite straightforward to me.

As far as other voices go, you can set the voice in the Windows speech control panel. You can install other voices, but they tend to not be free and/or easy to find. The voice engines from Neospeech have been recommended in this thread (thanks Andreasvb).


--------------------------------------------------
July 01, 2010 - Another new version is released!

Download foo_talktome.dll v0.5.1
(I don't know anything about version numbering andI felt I was approaching 1.0 much too quickly so I moved to a double-point system. Why not?)

Fixes/features:
* Improved volume scaling - this was indeed a linear/logarithmic scale thing (thanks kode54). Sadly the only reason I didn't do it properly the first time around is because I didn't have a pen or pencil handy. I'm pretty happy with the way it is now, but I may add another option to lower/boost the volume of the voice relative to the music if there is a lot of demand.
* Much bigger box for the speech formatting string. Thank carpman for requesting this - I never would have thought of it otherwise. Should accept 2048 characters or so now, hopefully that's big enough.

Enjoy!


--------------------------------------------------
July 19, 2010

Download foo_talktome.dll v0.6

Features:
* Now includes a volume-offset field in the preferences pane. You can use a negative or a positive offset, input in dB.

Hopefully this is helpful for some people.

NOTE: For those of you that keep Foobar set at 0.0dB attenuation (max volume) this will only help you make the TTS voice quieter. At this point I can only control the volume of the synthesized voice. If you want the voice louder relative to the music, try boosting your system volume, lowering your Foobar volume, and adding a positive volume offset in the TalkToMe preferences.

This post has been edited by aganders3: May 8 2013, 15:28
Go to the top of the page
+Quote Post
Andreasvb
post Jun 16 2010, 01:10
Post #2





Group: Members
Posts: 1337
Joined: 6-March 04
From: Sweden
Member No.: 12509



Thank you for making a TTS component for new foobar2000.

I used the old version before, until it stopped working in newer versions.

However, I found a way to get it announce the song, not optimal, but works.
It requires a bit tinkering.

This is what I used:

Cepstral: TTS program.
AMIP: For executing a command using swift.exe (comes with Cepstral).

Preset in AMIP:
/exec:(swift.exe) -p "%2 . by , %1"


I tried your component, it's working perfectly!

Even got another voice working, NeoSpeech Julie. It sounds really life-like.
If anyone want to use additional voices on 64 bit(unless they already are), just change it from the 32 bit SAPI settings.
C:\Windows\sysWOW64\speech\SpeechUX\SAPI.cpl

Thanks again.


--------------------
Windows 8.1u1 Pro x64 Media Center // foobar2000 1.3.3
Go to the top of the page
+Quote Post
carpman
post Jun 16 2010, 01:51
Post #3





Group: Developer
Posts: 1310
Joined: 27-June 07
Member No.: 44789



Hi aganders3

QUOTE
Failed to load DLL: foo_talktome.dll
Reason: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.


Using fb2k v.1.0.3 on Win XP SP2
Path to component directory:
C:\Program Files\foobar2000\3\foobar2000\components

Nothing else has had this problem.

Any ideas?

C.

EDIT: It's a "portable install" - does that make a difference?

This post has been edited by carpman: Jun 16 2010, 01:54


--------------------
TAK -p4m :: LossyWAV -q 6 | TAK :: Lame 3.98 -V 2
Go to the top of the page
+Quote Post
aganders3
post Jun 16 2010, 04:53
Post #4





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



QUOTE (carpman @ Jun 15 2010, 19:51) *
QUOTE
Failed to load DLL: foo_talktome.dll
Reason: This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.




First of all, thanks to both of you for trying out my plugin! This is my first "published" project, and it's good to know even one other person is using it.

My guess is that this is a "side-by-side configuration" error which has something to do with specific versions of certain dlls on windows system. I think it's the Microsoft solution to dll hell. I'm using Visual Studio 2008, so my program is linked to the dll files that come with it. You can install the VS2008 redistributable package if you are willing, and I think it will fix the problem. It's only a 4MB download, but it's still a hassle to have to urge users to install something else just to run my measly component.

I'll try to build the component again with statically linked dependencies, which should make this issue go away. I'm not sure exactly how to do that (kind of new to Visual Studio) but I think I can figure it out relatively quickly. In the mean time, I hope the VS2008 redistributable package solves the problem for anyone who encounters it.
Go to the top of the page
+Quote Post
aganders3
post Jun 16 2010, 16:38
Post #5





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



QUOTE
I'll try to build the component again with statically linked dependencies, which should make this issue go away. I'm not sure exactly how to do that (kind of new to Visual Studio) but I think I can figure it out relatively quickly. In the mean time, I hope the VS2008 redistributable package solves the problem for anyone who encounters it.

I just rebuilt the application and I think it's all statically linked now. Anyone who was getting the "configuration error" upon loading should re-download (the link in the first post is updated) and try again. Unfortunately I don't have access to any computer without VS2008 (or at least the redistributable package) installed, so I can't test this myself.

Please let me know if this problem remains, and likewise if you encounter any other problems with this component.
Go to the top of the page
+Quote Post
Andreasvb
post Jun 16 2010, 16:45
Post #6





Group: Members
Posts: 1337
Joined: 6-March 04
From: Sweden
Member No.: 12509



REQ/BUG: Make it remember the state.
It's always off when restarting foobar2000.

Besides that it's working fine so far.


--------------------
Windows 8.1u1 Pro x64 Media Center // foobar2000 1.3.3
Go to the top of the page
+Quote Post
foosion
post Jun 16 2010, 17:56
Post #7





Group: FB2K Moderator (Donating)
Posts: 4409
Joined: 24-February 03
Member No.: 5153



aganders3: You can a DLL's dependencies using a tool like Dependency Walker.


--------------------
http://foosion.foobar2000.org/ - my components for foobar2000
Go to the top of the page
+Quote Post
lvqcl
post Jun 16 2010, 18:07
Post #8





Group: Developer
Posts: 3326
Joined: 2-December 07
Member No.: 49183



Downloaded foo_talktome.dll. It wants c:\windows\winsxs\x86_microsoft.vc90.crt_blahblah\MSVCR90.DLL

(I think that 36352 bytes is too little for statically linked fb2k plugin...)
Go to the top of the page
+Quote Post
aganders3
post Jun 16 2010, 19:55
Post #9





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



Thanks everyone. I'm working on getting things statically linked, so I appreciate the suggestions and reports. My dll is like 105k now, so I may have figured it out, and I am going to run it though the dependency walker.

I am also working on saving the state of the plugin, but it may require some restructuring of the plugin. I will definitely have that working in the next release.
Go to the top of the page
+Quote Post
aganders3
post Jun 22 2010, 17:22
Post #10





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



OK, it took some playing around, but the new version seems to be working!

Download foo_talktome v0.4
(The link in the OP should be up-to-date as well.)

(Hopefully) Fixed in this version:
* No more dll dependencies, everything should be statically linked (Still figuring out dependency walker, but I hope it's working)
* Remembers the state on shutdown

Thanks again to everyone who has downloaded or shown interest in my plugin! This has been a great learning experience for me so far.
Go to the top of the page
+Quote Post
Andreasvb
post Jun 22 2010, 17:43
Post #11





Group: Members
Posts: 1337
Joined: 6-March 04
From: Sweden
Member No.: 12509



Now it remember the state on restart.

It's us that should thank you for making it. ^^

A little req, have it fade down the volume during the speech, like the original component.
And maybe announce before the next song.

Thanks again.


--------------------
Windows 8.1u1 Pro x64 Media Center // foobar2000 1.3.3
Go to the top of the page
+Quote Post
aganders3
post Jun 22 2010, 18:37
Post #12





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



QUOTE (Andreasvb @ Jun 22 2010, 11:43) *
Now it remember the state on restart.

It's us that should thank you for making it. ^^

A little req, have it fade down the volume during the speech, like the original component.
And maybe announce before the next song.

Thanks again.


I appreciate both the compliments and the requests. I am working on a preferences pane that should make the plugin much more customizable, and I'll definitely keep your suggestions in mind for it. I have no prior experience with WTL programming, though, so that may take a little longer to figure out!
Go to the top of the page
+Quote Post
s33m33
post Jun 22 2010, 21:54
Post #13





Group: Members
Posts: 246
Joined: 4-January 07
Member No.: 39305



Thanks Aganders3.

Useful plugin.
Go to the top of the page
+Quote Post
carpman
post Jun 22 2010, 23:53
Post #14





Group: Developer
Posts: 1310
Joined: 27-June 07
Member No.: 44789



Hi aganders3

Great that you got it working. biggrin.gif Works for me on XP.

I have one potential bug (though an odd one), and some suggestions / questions:

1) Bug? When the volume slider is set to zero, at least with my setup (see below), the component causes a really nasty loud noise/tone (square wave-ish). SEE EDIT 2 BELOW

Win XP SP2, soundcard is M-Audio Audiophile 2496 (let me know if you need any more details).


2) Suggestion: Is there any way to enter options re. title formatting to alter what gets announced? Currently, unless I've missed something, there's only %title% by %artist%.

It would be really good if we could enter a script in a settings dialogue. I want to use this component for comparing different versions of classical pieces, while away from the computer: So I want something like:
%title% by %artist% performed by %performer%

i.e. String Quartet No.4 in D major - Allegretto by Shostakovich performed by St Petersburg Quartet.

This then becomes quite a long intro, so:

3) suggestion: Is it possible to delay the music until the introduction has finished?

4) Is it possible to get alternative voice styles, and would this be possible via a drop down menu in a settings panel?

Regardless of whether you choose to impliment any of the above, I hope it's food for thought and potentially helpful.
Thanks for the component - appreciate your effort, and look forward to future developments.

Cheers,

C.

EDIT: Just realised that some of this is already covered by Andreasvb. So read as a +1.

EDIT2: It's not as bad as it first appeared. To reproduce:
1) Vol set to 0
2) Begins new song (thus intro begins)
3) If closed at that point, when fb2k re-opened the nasty noise happens.

Pretty unlikely scenario, but somehow I happened upon it, so possible.



This post has been edited by carpman: Jun 23 2010, 00:03


--------------------
TAK -p4m :: LossyWAV -q 6 | TAK :: Lame 3.98 -V 2
Go to the top of the page
+Quote Post
aganders3
post Jun 28 2010, 18:12
Post #15





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



A new version is released!

Download foo_talktome v0.5
(The link in the OP is now current as well.)

New features:
* A preferences pane!
* You decide the speech formatting (uses built-in Foobar2000 title formatting strings)
* An option to pause playback while speaking

I also tried to fix the 0 volume bug that was brought up. I was never able to reproduce it, though, so I'm not sure the changes worked. I've taken note of the other suggestions in this thread (volume fading when speaking, announcing at the end of the song...), and I will try to work on them over time, but implementation of some of them is not quite straightforward to me.

As far as other voices go, you can set the voice in the Windows speech control panel. You can install other voices, but they tend to not be free and/or easy to find.
Go to the top of the page
+Quote Post
Andreasvb
post Jun 28 2010, 19:13
Post #16





Group: Members
Posts: 1337
Joined: 6-March 04
From: Sweden
Member No.: 12509



Thanks for you continuous work. smile.gif

Finding a good TTS isn't easy indeed.
I really recommend www.neospeech.com and listen to theirs.
They're not free, unfortunately. But you could find them in different ways. biggrin.gif


--------------------
Windows 8.1u1 Pro x64 Media Center // foobar2000 1.3.3
Go to the top of the page
+Quote Post
carpman
post Jun 29 2010, 02:58
Post #17





Group: Developer
Posts: 1310
Joined: 27-June 07
Member No.: 44789



aganders3
Absolutely superb! biggrin.gif Works really well and a nice simple settings panel. Many thanks!

@ Andreasvb, thanks for the tip wink.gif I listened to the samples, they are so much better than XP's robo-man.

C.


--------------------
TAK -p4m :: LossyWAV -q 6 | TAK :: Lame 3.98 -V 2
Go to the top of the page
+Quote Post
carpman
post Jun 30 2010, 01:16
Post #18





Group: Developer
Posts: 1310
Joined: 27-June 07
Member No.: 44789



Hi aganders3

Enjoying your plugin. smile.gif
I have 2 more suggestions, if you have the time and inclination:

1) Is it possible to extend the title formatting code box by quite a bit (perhaps even a few lines)? Personally, I've got some conditional code to announce classical music differently from other genres, and also I'm finding the $replace function handy, as VIII pronounced "Vee-eye-eye-eye", wears thin rather quickly.

2) Would it be possible to have an option to set the volume of the TTS voice as a % (or whatever) of the music? I've tried setting this in the Control Panel options, but it seems that the plugin uses which ever sound output option fb2k uses, which makes sense, but that means that one cannot control the relative volumes. At present my TTS voice is too loud in comparison to the music.

Many thanks for your already excellent plugin and for considering the above.

Cheers,

C.


--------------------
TAK -p4m :: LossyWAV -q 6 | TAK :: Lame 3.98 -V 2
Go to the top of the page
+Quote Post
aganders3
post Jun 30 2010, 20:45
Post #19





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



QUOTE (carpman @ Jun 29 2010, 19:16) *
1) Is it possible to extend the title formatting code box by quite a bit...

This should be fairly simple. I will definitely expand it to allow/show more characters, and I will look into allowing multiple lines of text.

QUOTE
2) Would it be possible to have an option to set the volume of the TTS voice as a % (or whatever) of the music?

This is also definitely do-able, but will probably take a little longer. I had a field for a "volume offset" in the preferences panel, but it wasn't working how I wanted it to so I left it out of the release. I just need to play around a bit to work out the different scales that Foobar and the TTS API use.

In short, both of these improvements should be in the next release.

This post has been edited by aganders3: Jun 30 2010, 20:45
Go to the top of the page
+Quote Post
carpman
post Jul 1 2010, 00:46
Post #20





Group: Developer
Posts: 1310
Joined: 27-June 07
Member No.: 44789



Well, that's extremely cool of you. Thank you.

C.


--------------------
TAK -p4m :: LossyWAV -q 6 | TAK :: Lame 3.98 -V 2
Go to the top of the page
+Quote Post
kode54
post Jul 1 2010, 02:13
Post #21





Group: Admin
Posts: 4576
Joined: 15-December 02
Member No.: 4082



You need to convert decibels to a linear scale. I'm not sure of the exact power to apply to it, though.
Go to the top of the page
+Quote Post
aganders3
post Jul 1 2010, 22:49
Post #22





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



July 01, 2010 - Another new version is released!

Download foo_talktome.dll v0.5.1
(I don't know anything about version numbering andI felt I was approaching 1.0 much too quickly so I moved to a double-point system. Why not?)

Fixes/features:
* Improved volume scaling - this was indeed a linear/logarithmic scale thing (thanks kode54). Sadly the only reason I didn't do it properly the first time around is because I didn't have a pen or pencil handy. I'm pretty happy with the way it is now, but I may add another option to lower/boost the volume of the voice relative to the music if there is a lot of demand.
* Much bigger box for the speech formatting string. Thank carpman for requesting this - I never would have thought of it otherwise. Should accept 2048 characters or so now, hopefully that's big enough.

Enjoy!
Go to the top of the page
+Quote Post
carpman
post Jul 2 2010, 01:22
Post #23





Group: Developer
Posts: 1310
Joined: 27-June 07
Member No.: 44789



Wow, that was fast!
Works for me -- really well. Just out of interest, how have you scaled the TTS voice? Presumably you can't know in advance how loud the TTS voice will be, so how does your plugin decide the ratio?

C.


--------------------
TAK -p4m :: LossyWAV -q 6 | TAK :: Lame 3.98 -V 2
Go to the top of the page
+Quote Post
aganders3
post Jul 2 2010, 17:42
Post #24





Group: Developer
Posts: 20
Joined: 15-June 10
Member No.: 81538



QUOTE (carpman @ Jul 1 2010, 19:22) *
Just out of interest, how have you scaled the TTS voice?

I am inverting the dB scale that Foobar uses to get a linear scale of 0-100 (what the TTS voice takes as a volume, only integer values). This is basically the same as how the Foobar volume control works; if you look, the actual dB value falls off much more quickly as you move to the low end.

The equation I use is:
TTS_volume = 100*10^(foobar_volume/20)

which comes from the equation for audio decibels (a relative measure):
dB = 20*log(P/Pref); where I use Pref = 100, the maximum TTS volume.
This gives the TTS voice a volume of 100 when Foobar's attenuation is 0dB, and ~0 when Foobar's attenuation is -100dB. I'm also not doing any rounding (laziness), so a value of (say) 13.94 will just get truncated to 13.

I just tried it at home (using Microsoft Anna on Win7) and it seems a little quiet. It's basically perfect (for me) on my other computer with Neospeech Julie, though, so the voice-dependent thing could work against people. This makes me want to implement another setting to boost/drop the voice a bit, so something like that will probably be in the next release smile.gif I'll play around with it a little to see what method seems to work best for that.

This post has been edited by aganders3: Jul 2 2010, 17:43
Go to the top of the page
+Quote Post
Andreasvb
post Jul 2 2010, 18:15
Post #25





Group: Members
Posts: 1337
Joined: 6-March 04
From: Sweden
Member No.: 12509



Why not just a simple volume slider? biggrin.gif
Will try the new version.

Ok, haha.

Now I can't hear anything, kind of.

foobar2000 is usually on -20 dB when listening normally, and -13.37 when it's loud.

The rest is configured accordingly, based on those values.

I'm using something called Virtual Audio Cable and have assigned "Line 2" for foobar2000 and "Line 3" for rest of Windows' audio.
TTS will use the default mixer, "Line 3", which is very low.


Main Volume Mixer:
Line 2 > 50%
Line 3 > 20%

So the max output for Line 2 is now 50% of the main Volume Mixer, and Line 3 is 20%.
Then you can change each output's own volume, also from 0-100%, which seems to be logarithmic ( http://msdn.microsoft.com/en-us/library/dd316769(VS.85).aspx ).

Line 2:
foobar2000 > 100%

Line 3:
foobar2000 (TTS) > 60%
mIRC > 2%
System > 5%


Summarized:

foobar2000 = 25% - Main (50) - Line 2 (50) (minus -20 dB in foobar2000) of total.
Line 3 = ~7% - Main (50) - Line 3 (20) - TTS (60).




This post has been edited by Andreasvb: Jul 2 2010, 19:09


--------------------
Windows 8.1u1 Pro x64 Media Center // foobar2000 1.3.3
Go to the top of the page
+Quote Post

3 Pages V   1 2 3 >
Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th July 2014 - 19:13