Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Google Text To Speech - Polskie Znaczki
sebax3x
post
Post #1





Grupa: Zarejestrowani
Postów: 43
Pomógł: 0
Dołączył: 8.03.2008

Ostrzeżenie: (0%)
-----


Chciałbym wykorzystać u siebie na stronie Google text to speech - mam problem.
Normalnie po pobraniu ręcznym z z adresu:
http://translate.google.com/translate_tts?tl=pl&q=jeść - jest ok
natomiast jak pobieram to samo skryptem za pomocą curla i zapisuję do mp3 (w celu odtworzenia na stronie) wtedy nie ma wymawianych polskich znaczków.
Zamiast "jeść" jest "je".
Używałem funkcji urlencode - ale nadal nic.
Pewnie jakiś problem z kodowaniem - męczę się z tym od dłuższego czasu. Będę bardzo wdzięczny za pomoc.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
sebax3x
post
Post #2





Grupa: Zarejestrowani
Postów: 43
Pomógł: 0
Dołączył: 8.03.2008

Ostrzeżenie: (0%)
-----


  1. <?
  2.  
  3. if(isset($_GET["word"])){
  4.  
  5. $q = $_GET["word"];
  6.  
  7. $video_url = 'http://translate.google.com/translate_tts?tl=pl&q='.urlencode(utf8_encode($q));
  8.  
  9. header("Expires: Thu, 19 Nov 1981 08:52:00 GMT");
  10. header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
  11. header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
  12. header("Pragma: no-cache");
  13. header("Content-Type: audio/mpeg3");
  14. header("Content-Disposition: attachment; filename=".$_GET["word"].".mp3;" );
  15. header("Content-Length: ".$size);
  16. header("Connection: close");
  17.  
  18. ob_flush();flush();$file = fopen($video_url, "rb");ob_flush();flush();
  19. while(!feof($file)){print fread($file, 100192);}
  20. fclose($file);
  21.  
  22. }
  23.  
  24. ?>


Można testować tutaj: http://joogle.pl/down.php?word=jeść

Ten post edytował sebax3x 2.02.2011, 14:22:31
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 8.10.2025 - 22:44