Doporučujeme: Snadné sdílení souborů | Stahovač videí z YouTube | TV program | Italo.cz | Zkracovač dlouhých adres | Zkus to jinak - logicky | Služby pro Váš web

Můj blog – až 10 % špičkového kódu navíc!

Audacity spadl při nahrávání: jak data získat zpět?

Datum: 1. 1. 2007 19.00 | Autor: Lukáš | 22914× | Kategorie: PHP | Komentáře: 399

Dnes v noci jsem si nahrával m2On Year 07 (speciální silvestrovský přímý přenos z Rimini) a hned poté m2o Only 90 (celý den jen super stará dobrá muzika z 90. let). Nahrávání jsem tedy nechal jet přes noc.

Po více než třinácti hodinách záznamu však program Audacity z ničeho nic přestal nahrávat. Dokonce v něm ani nešlo spustit již zaznamenaná data. Jakoby se prostě vypařila. Na disku mi však zůstalo 16 GB dat v téměř 16400 souborech. Žádným z importů, které program nabízí, nešlo data dostat zpět do ucelené formy. Naštěstí jsem po chvíli zkoumání zjistil, že je-li nahrávka uložena jako projekt, program si vytvoří samostatný XML soubor, ve kterém jsou zaznamenány informace o všech souborech a času jejich umístění. No a protože se mi doopravdy nechtělo ručně zapisovat do souboru všech 16 tisíc řádků, rozhodl jsem se pro vygenerování souboru pomocí php - a je to opravdu velmi jednoduché!

Zde je kompletní zdrojový kód, prosím, čtěte v něm umístěné komentáře!

  1 <?

  2
  3
/* do atributu projectname nastavíme název složky, ve které jsou umístěny všechny datové soubory */
  4
  5
$content '<?xml version="1.0"?>
  6 <audacityproject projname="audacity_temp" version="1.1.0" audacityversion="1.2.4" sel0="0.0000000000" sel1="0.0000000000" vpos="0" h="9.5550113379" zoom="86.1328125000" rate="44100.000000" >
  7     <tags title="" artist="" album="" track="-1" year="" genre="-1" comments="" id3v2="1" />
  8 '
;
  9
 10
 11
/* jelikož Audacity ukládá hudbu pro každý kanál zvlášť, uložíme si do dvou různých proměnných data pro určitý kanál - u prvního MUSÍ být channel="0" a u druhého MUSÍ být channel="1"
 12
 13 hodnota maxsamples je maximální hodnota dat uložených v jednom souboru - doporučuji nejdříve zkusit něco nahrát a podívat se do výsledného *.aup souboru, po jak velkých částech Váš program ukládá data
 14
 15 numsamples je asi celkový počet uložených dat, nicméně já ho nijak neměnil a i tak mi to fungovalo */
 16
 17
$content1='    <wavetrack name="Audio stopa" channel="0" linked="1" offset="0.00000000" rate="44100.000000" gain="1.000000" pan="0.000000" >
 18         <sequence maxsamples="262144" sampleformat="262159" numsamples="801280" >
 19 '
;
 20
 21
 22
$content2='    <wavetrack name="Audio stopa" channel="1" linked="0" offset="0.00000000" rate="44100.000000" gain="1.000000" pan="0.000000" >
 23         <sequence maxsamples="262144" sampleformat="262159" numsamples="801280" >
 24 '
;
 25
 26
 27
/* zde už přichází na řadu samotné generování dat
 28
 29 16368 je počet souborů uložených ve složce, kterou jste výše nastavili!
 30
 31 atribut len MUSÍ mít stejnou hodnotu jako je hodnota maxsamples popisovaná výše, to samé číslo vepište u $start=$start+262144; */
 32
 33
$start=0;
 34
 35 for(
$i=0;$i<=16368;$i++){
 36
 37
 38 if(
strlen($i)==1){
 39
$cislo="0000".$i;
 40 }
 41 elseif(
strlen($i)==2){
 42
$cislo="000".$i;
 43 }
 44 elseif(
strlen($i)==3){
 45
$cislo="00".$i;
 46 }
 47 elseif(
strlen($i)==4){
 48
$cislo="0".$i;
 49 }
 50 elseif(
strlen($i)==5){
 51
$cislo=$i;
 52 }
 53
 54
 55
 56 if(
$i%2==0){
 57
 58     
$content1.='    <waveblock start="'.$start.'" >
 59         <simpleblockfile filename="b'
.$cislo.'.au" len="262144"/>
 60     </waveblock>
 61 '
;
 62
 63 }
 64 else{
 65
 66     
$content2.='    <waveblock start="'.$start.'" >
 67         <simpleblockfile filename="b'
.$cislo.'.au" len="262144"/>
 68     </waveblock>
 69 '
;
 70
 71 }
 72
 73
 74
 75 if(
$i%2==0){
 76     
$start=$start+262144;
 77 }
 78
 79 }
 80
 81
 82
/* uzavřeme všechny tagy */
 83
 84
$content1.="        </sequence>
 85         <envelope numpoints='0'>
 86         </envelope>
 87     </wavetrack>
 88 "
;
 89
 90
 91
$content3="        </sequence>
 92         <envelope numpoints='0'>
 93         </envelope>
 94     </wavetrack>
 95 "
;
 96
 97
 98
$content4='</audacityproject>';
 99
100
101
102
/* spojíme proměnné */
103
104
$globalcontent=$content.$content1.$content2.$content3.$content4;
105
106
$soubor fopen("./aaa.aup""w+"); // vytvoříme soubor
107
fwrite($soubor$globalcontent);
108
fclose($soubor);
109
110
111
112
?>

Vytvořený soubor otevřte v programu Audacity. To je vše.


Podobné články:
Hromadné nahrávání souborů na megaupload.cz
Jak na ztracená data z disku?


Komentáře:

  1. Avast Customer Support1. 4. 2019 12.21

    Thanks for sharing this post.I am very pleased to read this article.



    odpovědět
  2. office.com/setup3. 4. 2019 11.27

    I am thankful for the article post.Looking forward to visit more.



    odpovědět
  3. kashmir tour packages3. 4. 2019 11.27

    It gives us immense pleasure to introduce ourself and our travel hub one of the premier travel hubs in the state of Jammu & Kashmir.



    odpovědět
  4. norton.com/setup6. 4. 2019 12.16

    Norton Antivirus, Norton Internet Security Suite, Norton Security, Norton 360, Norton for Mac, Norton 2016.



    odpovědět
  5. www.office.com/setup22. 4. 2019 16.34

    I am convinced that your website is convinced that weblog is very new. Probably I am going to bookmark your site. There are certainly impressive stories. Passion for sharing your website with us.



    odpovědět
  6. www.office.com/setup22. 4. 2019 16.34

    I am convinced that your website is convinced that weblog is very new. Probably I am going to bookmark your site. There are certainly impressive stories. Passion for sharing your website with us.



    odpovědět
  7. mcafee.com/activate23. 4. 2019 13.39

    The antivirus application you using for installation is most recent version.



    odpovědět
  8. Office.com/setup | www.of3. 5. 2019 10.30

    Listed on office setup are the steps in the installation of this software and other things that need to be done by going to office.com/setup and follow the on-screen instructions: http://officecomoffice-com.com/



    odpovědět
  9. www.office.com/setup - Of3. 5. 2019 10.32

    office.com/setup - For Downloading, Installing and activating the Office product key, visit www.office.com/setup and Get Started by now Office setup. http://officecomcomoffice.com/



    odpovědět
  10. www.Norton.com/Setup -Nor3. 5. 2019 10.33

    Norton is a general respected support.norton.com stamp offering the best of antivirus www.norton.com/setup relationship around the globe. Compelling its structures and sorts, it gives particular changes which meet the certain need of the customers. http://nortoncomnortoncom.com/



    odpovědět
  11. Norton.com/setup | norton3. 5. 2019 10.33

    Ensure every one of your gadgets with your Norton membership My Norton setup makes it simple for you to set up your Norton assurance, check your security status, and stretch out your insurance to different PCs, Macs, cell phones, and tablets. http://norton-norton.com/



    odpovědět
  12. Norton.com/setup3. 5. 2019 10.34

    Ensure every one of your gadgets with your Norton membership My <a href=" http://norton-norton.com ">norton setup</a> makes it simple for you to set up your <a href=" http://norton-norton.com "> norton.com/setup </a> assurance, check your security status, and stretch out your insurance to different PCs, Macs, cell phones, and tablets. <a href=" http://norton-norton.com ">www.norton.com/setup </a>.



    odpovědět
  13. Norton.com/Setup8. 5. 2019 11.41

    It really makes me happy and I am satisfied with the arrangement of your post. You are really a talented person I have ever seen.



    odpovědět
  14. office.com/setup9. 5. 2019 12.33

    office.com/setup : Office suite is having multiple applications which is being used by professionals and non professionals.



    odpovědět
  15. mcafee.com/activate10. 5. 2019 8.25

    McAfee for any kind of technical help and Office Setup.



    odpovědět
  16. Norton.com/Setup11. 5. 2019 11.17

    It really makes me happy and I am satisfied with the arrangement of your post. You are really a talented person I have ever seen.



    odpovědět
  17. www.office.com/setup13. 5. 2019 11.16

    Microsoft Office includes Access, Excel, PowerPoint, Outlook, Word, Publisher,
    Office 365, Office 2016, Office 2013, Office 2010, Office 2007,



    odpovědět
  18. Norton.com/setup20. 5. 2019 8.41

    Norton has a wide scope of items and administrations that can be introduced in type of use on the diverse gadget. After establishment of the Norton Product, you have to initiate the Norton utilizing the Norton Product Key.



    odpovědět
  19. norton.com/setup23. 5. 2019 7.24

    You will need your Norton Account to install Norton Product on your device.



    odpovědět
  20. www.office.com/setup23. 5. 2019 13.20

    In case any message saying ‘Stop’ pops up while installing Microsoft Office 365 due to a compatibility issue, contact our live chat support.
    <a href="http://www-officecomsetup.com/">www.office.com/setup</a>



    odpovědět
  21. Norton Com Product Key31. 5. 2019 11.18

    Install & Activate Norton Security to get protection against threats & infections over the internet.



    odpovědět
  22. Norton.com/Setup3. 6. 2019 12.23

    Thank you so much for this wonderful Post and all the best for your future. I hope to see your posts more often.



    odpovědět
  23. office.com/setup8. 6. 2019 11.20

    Information is pretty good and impressed me a lot.



    odpovědět
  24. office setup8. 6. 2019 12.22

    Many people are now usual of working on PC.



    odpovědět
  25. My assignment helper10. 6. 2019 8.28

    Thanks for the information you provided. Regards
    Sohobiztube

    https://www.sohobiztube.com

    <a href=“https://www.sohobiztube.com”> Sohobiztube- Directory Submission </a>

    Nice Post !! Before hiring Someone for Assignments check the comments for them at Find Assignment Services.
    <a href= "http://www.findassignmentservice.com/">Find Assignment Services</a>

    MyAssignmentHelper.co.uk is among the best companies on the online assignment writing market. We offer top-notch essays, Assignments, research papers, thesis and other types of works that can be assigned to you at a high school or college. Check out what we offer, try working with our paper writing service.

    <a href="https://myassignmenthelper.co.uk/"> My Assignment Helper UK </a>



    odpovědět
  26. Find assignment service10. 6. 2019 8.34

    Nice Post !! Before hiring Someone for Assignments check the comments for them at Find Assignment Services.
    <a href= "http://www.findassignmentservice.com/">Find Assignment Services</a>



    odpovědět
  27. sohobiztube10. 6. 2019 8.35

    Thanks for the information you provided. Regards
    Sohobiztube

    https://www.sohobiztube.com

    <a href=“https://www.sohobiztube.com”> Sohobiztube- Directory Submission </a>



    odpovědět
  28. makemyassignments10. 6. 2019 8.36

    Good Inspirational Content. Thanks for telling and changing perception.
    We provide academic content help services to students who are looking for assignments help for their high school and colleges.
    Visit :
    <a href=“https://www.makemyassignments.com/” > Make my Assignments </a>
    https://www.makemyassignments.com/au/
    https://www.makemyassignments.com/nz/



    odpovědět
  29. My assignment helper10. 6. 2019 8.36

    MyAssignmentHelper.co.uk is among the best companies on the online assignment writing market. We offer top-notch essays, Assignments, research papers, thesis and other types of works that can be assigned to you at a high school or college. Check out what we offer, try working with our paper writing service.

    <a href="https://myassignmenthelper.co.uk/"> My Assignment Helper UK </a>



    odpovědět
  30. www.webroot.com/safe12. 6. 2019 8.34

    Webroot safe antivirus products are developed with the primary goal of giving a user peace of mind in the context of online safety. It doesn’t matter whether a person is accessing the internet for personal use or has a small to big-sized business; Webroot.com/safe has perfect security solutions for everybody.



    odpovědět
  31. Avast customer service13. 6. 2019 9.12

    It’s very informative and you are obviously very knowledgeable in this area. You have opened my eyes to varying views on this topic with interesting and solid content



    odpovědět
  32. Avast customer service13. 6. 2019 9.15

    It’s very informative and you are obviously very knowledgeable in this area. You have opened my eyes to varying views on this topic with interesting and solid content



    odpovědět
  33. Paper Writer21. 6. 2019 11.31

    After graduating from an eminent UK university, I worked as a paper writer for several years. Now I assist students in writing assignments. Due to I expertise, I compose All assignment help for Uk students. I procure customized and appropriate format based on one of the best academic referencing styles including Harvard, APA,Chicago and MLA referencing styles.



    odpovědět
  34. Bitdefender LoginDnes, 10.49

    Bitdefender Login offers unmatched security coverage for all your connected devices including Windows, Mac, Androids. iOS, etc. It is globally recommended for utmost convenience both at the time of usage and setup.



    odpovědět
  35. my.avast.comDnes, 10.50

    Granted that today’s world of cyber threats is extremely complex and hazardous. Henceforth, the age-old traditional methods are no longer satisfactory. Therefore, necessity of a swift, ingenious and dependable cybersecurity is felt more seriously than ever before.



    odpovědět
  36. Norton.com/setupDnes, 15.06

    Garmin.com/express - Garmin Connect is an application which can be installed on your mobile devices to collect the data from your Garmin product. Here we are explaining the features of Garmin Express as well as the process to Download and Install Garmin Express on your system.



    odpovědět
  37. Garmin.com/expressDnes, 15.06

    Garmin.com/express - Garmin Connect is an application which can be installed on your mobile devices to collect the data from your Garmin product. Here we are explaining the features of Garmin Express as well as the process to Download and Install Garmin Express on your system.



    odpovědět
  38. Tomtom updateDnes, 15.07

    Tomtom Update - TomTom is popular name when it comes to the navigation and GPS device. Also, other services include action cameras, GPS sports watches, fleet management systems, and location-based products. You can visit the TomTom.com and check various products and services offered by the TomTom.



    odpovědět
  39. Norton.com/setupDnes, 15.07

    Norton.com/setup - Norton, the world’s largest security software provides high-end protection against all kinds of threats and viruses lurking in the internet marking. These viruses, Trojan horses, scams and other malicious the software can harm important data and steal your confidential information (while accessing your bank account online).You can choose any Norton security software from those mentioned below as per your specific requirements.



    odpovědět

Přidat nový komentář:




Ochrana proti spamu. Napište prosím číslici pět: