Welcome to the Text to Speech Sound Generation project built using Next.js! This project demonstrates the generation of sound using pre-trained hugging face models. Users can select different hugging face sound models and input text to generate corresponding audio. The generated audio can be played back directly on the web interface.
This project showcases how to leverage pre-trained hugging face models along with the Hugging Face inference API to convert input text into synthesized speech. The user interface provides a selection of sound models to choose from and an input field to enter the desired text. Once submitted, the application fetches the generated audio from the model's API and presents it in an audio player.
This application relies heavily on the stability of the Hugging Face Inference API models. Please note that occasional random errors may occur.
- Node.js
- npm
- Clone the repository:
git clone https://github.com/sambowenhughes/your-nextjs-project.git
- Navigate to the project directory:
cd your-nextjs-project
- Install dependencies:
npm install
- Hugging Face Access Token added to your
.env.local
file:Hugging face tokens can be created in the hugging face settings portal
- Start the development server:
npm run dev
- Open your browser and visit
http://localhost:3000
to access the application.
components
: Contains reusable UI components used across the application.lib
: Contains constants and utility functions.pages
: Houses the main views and API routes of the application.public
: Holds static assets like images, fonts, etc.styles
: Includes global and component-specific styles using CSS or CSS-in-JS.views
: Houses the main application views and components.
- Open the application in your browser after running it.
- In the "Sound Model" dropdown, select a model for generating sound.
- Enter the desired text in the "Text" input field.
- Click the "Submit" button.
- The generated audio will appear in an audio player below.
Contributions are welcome! To contribute, follow these steps:
- Fork the repository.
- Create a new branch for your feature or bug fix.
- Implement your changes and test them thoroughly.
- Commit your changes and push to your forked repository.
- Open a pull request to the main repository.
This project is licensed under the MIT License.