Code Monkey home page Code Monkey logo

vocalizer's Introduction

Vocalizer CDNJS

A super simple javascript plugin to help others say your name correctly.

Here's how to get it working:

  1. Download and include vocalizer.min.js into your website. Or just include it via CDN: <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/vocalizer/1.0.0/vocalizer.min.js"></script>.
  2. Wrap your first name in a span tag like this: <span class="vocalizer" data-source="auto" data-lang="English">YOUR NAME</span>.
  3. That's it! You can read the backstory on this idea here.

The data-source attribute has two parameter options:

  • auto : The audio will automatically be generated. Note: If this doesn't work, it might mean your name doesn't exist in the database. Go here and search the name to double-check. If it isn't there you'll have to use your own audio file.
  • path/to/file : Manually set the path to your own audio file. For example: <span class="vocalizer" data-source="audio/name.mp3">.

The optional data-lang attribute let you select the language used for the pronunciation, by entering the full language name.

Preset audio recordings are provided by the Nameshouts API.

vocalizer

Want to contribute?

A lot of improvements can be made to this project. If you would like to help make Vocalizer better, I've labeled improvements as "up-for-grabs" in the issues section. Feel free to submit pull requests :)

Questions, comments, suggestions, issues?`

If so, please file an issue. ``

vocalizer's People

Contributors

atifazam avatar karamfd avatar peterdavehello avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

vocalizer's Issues

Add to cdnjs

I would be awesome if you could submit this library to cdnjs (https://cdnjs.com/) or a similar JavaScript library CDN, so that people can just enqueue the library from such a CDN instead of hosting it themselves.

Thanks for a useful but of code! :)

js error

#Hello,

I have JavaScript error when I use CDN or local files

TypeError: document.body is null
e()
vocalizer.min.js:1

vocalizer.min.js:1

vocalizer.min.js:1

Never mind, after I place reference to js at the bottom of the page it works.

Console Errors when using this plugin on a wordpress site

Hello,

It seems to be a great light-weight plugin that we would like to use, but when I follow the steps on getting it to work, it's giving me a lot of errors.
Please find the error messages below and a screenshot attached.
==============ERRORS=============
Access to XMLHttpRequest at 'https://www.nameshouts.com/api/names/naureenanwar' from origin 'https://XXXXX' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: It does not have HTTP ok status.

Uncaught SyntaxError: Unexpected token u in JSON at position 0
at JSON.parse ()
at vocalizer.min.js?ver=20151215:1:681
at a.onerror (vocalizer.min.js?ver=20151215:1:467)

Failed to load resource: net::ERR_FAILED www.nameshouts.com/api/names/naureenanwar:1

==============ERRORS=============
Capture2

When I tried using this method:
Naureen Anwar
or just this simple name
John

this gives me the errors mentioned above. But when I tried this method (custom mp3 audio):

John

This works and plays the audio. This doesn't give me any errors.

How can I fix this?

Thank you!

Initializing dynamically

Hi,
Could you make it possible to somehow load new instances dynamically, instead of only on page load? For example, by exposing a function that accepts an element.

Ability to change color of audio pronunciation button

A person should be able to specific a data-button-color attribute on the <span> and provide a hex code color to override the default button color.

Example:
<span class="vocalizer" data-source="auto" data-button-color="#cc000">$NAME$</span>

Any takers?

Compound name option?

Hello,

A few things:

  1. Is there a way to have the script work with compound names? For example mine: ricardo zea.
  2. Also, it would be nice to be able to select the language in which we want the name to be pronounced in.
  3. In this Pen you can test how the same name (mine in this case) is pronounced differently, with a different voice and a different tone. Is there a way to make the script use a specific tone and pronunciation? I assume that's something related to the language, but I'm not entirely sure.

Anyhow, this is a GREAT script, Thanks for sharing it :) 👍

Bower component

Nice module
I suggest distribute it in bower, what you think?

SVG for icon?

Thank you for building this. This is awesome!

Would you be open to using an SVG icon instead of loading a icon font library? It is a bit much to download an additional ~50kb of assets just to display one icon. Here is the SVG code for the actual material icon:

<svg width="24" height="24" viewBox="0 0 24 24" id="ic_volume_up_24px" x="120" y="192">
  <path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3A4.5 4.5 0 0 0 14 7.97v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"/>
</svg>

I can submit a PR but, it seems the repo only has minified code.

Return error for missing names

When a name being used is not present in the Nameshouts API, it should do two things:

  1. console.log and error message saying, "Name not found on Nameshouts.com"
  2. display:none the audio button

API key not configurable

After a quick scan of the minified code and the documentation, I don't seen any way to change the NameShouts API key without changing the source. Should this be a <meta> (to continue with the pure markup theme of the API) or should it be part of a new API (e.g. new Vocalizer(apiKey))?

How to specify the country?

Many names have recordings from different countries (e.g. Michael). Is there a way to specify the preferred country?

Only works on local server

Hi, i have been triying to make it work on my little site but it only works on my local wamp server why is that?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.