Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: foo_talktome (Read 49460 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_talktome

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.

[!--sizeo:3--][span style=\"font-size:12pt;line-height:100%\"][!--/sizeo--]Please use the issue tracker on the BitBucket Repo to report bugs/feature requests.[/size]

--------------------------------------------------
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.

foo_talktome

Reply #1
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 10 Pro x64 // foobar2000 1.3.10

foo_talktome

Reply #2
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?
PC = TAK + LossyWAV  ::  Portable = Opus (130)

foo_talktome

Reply #3
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.

foo_talktome

Reply #4
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.

foo_talktome

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

Besides that it's working fine so far.
Windows 10 Pro x64 // foobar2000 1.3.10


foo_talktome

Reply #7
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...)

foo_talktome

Reply #8
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.

foo_talktome

Reply #9
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.

foo_talktome

Reply #10
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 10 Pro x64 // foobar2000 1.3.10

foo_talktome

Reply #11
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!

foo_talktome

Reply #12
Thanks Aganders3.

Useful plugin.

foo_talktome

Reply #13
Hi aganders3

Great that you got it working.    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.

PC = TAK + LossyWAV  ::  Portable = Opus (130)

 

foo_talktome

Reply #14
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.

foo_talktome

Reply #15
Thanks for you continuous work.

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.
Windows 10 Pro x64 // foobar2000 1.3.10

foo_talktome

Reply #16
aganders3
Absolutely superb!    Works really well and a nice simple settings panel. Many thanks!

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

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

foo_talktome

Reply #17
Hi aganders3

Enjoying your plugin. 
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.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

foo_talktome

Reply #18
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.

foo_talktome

Reply #19
Well, that's extremely cool of you. Thank you.

C.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

foo_talktome

Reply #20
You need to convert decibels to a linear scale. I'm not sure of the exact power to apply to it, though.

foo_talktome

Reply #21
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!

foo_talktome

Reply #22
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.
PC = TAK + LossyWAV  ::  Portable = Opus (130)

foo_talktome

Reply #23
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  I'll play around with it a little to see what method seems to work best for that.

foo_talktome

Reply #24
Why not just a simple volume slider?
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).


Windows 10 Pro x64 // foobar2000 1.3.10