PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Tuesday, August 30, 2022

[FIXED] How to combine audio files with PHP?

 August 30, 2022     audio, pear, php     No comments   

Issue

I want to create a basic speech software, where the PHP program combines a few ready-made sounds (such as the, cat, sat, on, the, mat), and then allows the user to download the finished file (which then, following from the above example, would say the cat sat on the mat).

A few options I have considered:

  • Some kind of PHP or PEAR library (not PEAR if possible please)
  • Reading using a binary-safe reading function from all the audio files, then combining them manually

Are there any I have missed? Or have I not covered the correct option yet?


Solution

If you really need to do this using native PHP, then you're probably out of luck.

I don't know about your exact need, but the I would second the idea to use a dedicated library, such as SoX, driven by your PHP code through exec().

Also, supposing you are writing a web application, expect the processing time to be long enough that you will have to manage running async sound generation.



Answered By - Eric Redon
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

1,208,701

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © 2025 PHPFixing