{"id":5389,"date":"2025-11-26T15:57:46","date_gmt":"2025-11-26T14:57:46","guid":{"rendered":"https:\/\/workboot.fr\/ciela\/?page_id=5389"},"modified":"2025-11-26T16:09:16","modified_gmt":"2025-11-26T15:09:16","slug":"open-close-2","status":"publish","type":"page","link":"https:\/\/workboot.fr\/ciela\/open-close-2\/","title":{"rendered":"open \/ close"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Installation de l\u2019utilitaire de son Audacity<\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>sudo apt update &amp;&amp; sudo apt install audacity -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">G\u00e9n\u00e9rer un fichier son de une seconde un LA \u00e0 440 Hz<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">fichier : la.c<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"c\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">#include &lt;stdio.h>\n#include &lt;stdlib.h>\n#include &lt;math.h>\n#include &lt;stdint.h>\n#include &lt;string.h>\n#include &lt;unistd.h>\n#include &lt;fcntl.h>\n#include &lt;sys\/types.h>\n#include &lt;sys\/stat.h>\n\n#ifndef M_PI\n#define M_PI 3.14159265358979323846\n#endif\n\nvoid write_wav_header(int fd, uint32_t sample_rate, uint32_t data_size) \n{\n    uint32_t file_size = data_size + 36; \/* 44 - 8 *\/\n    uint32_t fmt_size = 16;\n    uint16_t audio_format = 1; \/* PCM *\/\n    uint16_t num_channels = 1; \/* mono *\/\n    uint32_t byte_rate = sample_rate * num_channels * 8 \/ 8;\n    uint16_t block_align = num_channels * 8 \/ 8;\n    uint16_t bits_per_sample = 8;\n    \n    \/* \u00c9criture de l'en-t\u00eate RIFF *\/\n    write(fd, \"RIFF\", 4);\n    write(fd, &amp;file_size, 4);\n    write(fd, \"WAVE\", 4);\n    \n    \/* \u00c9criture du chunk fmt *\/\n    write(fd, \"fmt \", 4);\n    write(fd, &amp;fmt_size, 4);\n    write(fd, &amp;audio_format, 2);\n    write(fd, &amp;num_channels, 2);\n    write(fd, &amp;sample_rate, 4);\n    write(fd, &amp;byte_rate, 4);\n    write(fd, &amp;block_align, 2);\n    write(fd, &amp;bits_per_sample, 2);\n    \n    \/* \u00c9criture du chunk data *\/\n    write(fd, \"data\", 4);\n    write(fd, &amp;data_size, 4);\n    return;\n}\n\nint main(int argc, char **argv) \n{\n    const char *filename = \"la440.wav\";\n    const uint32_t sample_rate = 8000;\n    const uint32_t duration = 1;\n    const double frequency = 440.0;\n    const double amplitude = 127.0;\n    const double offset = 128.0;\n    \n    const uint32_t num_samples = sample_rate * duration;\n    const uint32_t data_size = num_samples;\n\n    uint32_t i;\n    double time;\n    double sample;\n    uint8_t audio_sample;\n        \n    \/* Ouverture du fichier avec open() *\/\n    int fd = open(filename, O_WRONLY | O_CREAT | O_TRUNC, 0644);\n    if (fd == -1) {\n        printf(\"Erreur: impossible de cr\u00e9er le fichier %s\\n\", filename);\n        return EXIT_FAILURE;\n    }\n    \n    \/* \u00c9criture de l'en-t\u00eate manuellement *\/\n    write_wav_header(fd, sample_rate, data_size);\n    \n    \/* G\u00e9n\u00e9ration des donn\u00e9es audio *\/\n    for ( i = 0 ; i &lt; num_samples; i++) \n    {\n        time = (double)i \/ sample_rate;\n        sample = sin(2.0 * M_PI * frequency * time);\n        audio_sample = (uint8_t)(offset + amplitude * sample);\n        write(fd, &amp;audio_sample, 1);\n    }\n    \n    \/* Fermeture du fichier *\/\n    close(fd);\n    \n    printf(\"Fichier %s cr\u00e9\u00e9 avec succ\u00e8s!\\n\", filename);\n    printf(\"Format: 8 bits mono, %d Hz, 1 seconde\\n\", sample_rate);\n    printf(\"Fr\u00e9quence: %.1f Hz (La4)\\n\", frequency);\n    \n    return EXIT_SUCCESS;\n}\n<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Pour compiler :<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>gcc la.c -o la -Wall -ansi -pedantic -lm -g <\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">pour \u00e9couter le fichier son g\u00e9n\u00e9r\u00e9<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>audacity la440.wav<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Installation de l\u2019utilitaire de son Audacity G\u00e9n\u00e9rer un fichier son de une seconde un LA \u00e0 440 Hz fichier : la.c Pour compiler : pour \u00e9couter le fichier son g\u00e9n\u00e9r\u00e9<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_crdt_document":"","_uag_custom_page_level_css":"","footnotes":""},"class_list":["post-5389","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>open \/ close - workboot<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/workboot.fr\/ciela\/open-close-2\/\" \/>\n<meta property=\"og:locale\" content=\"fr_FR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"open \/ close - workboot\" \/>\n<meta property=\"og:description\" content=\"Installation de l\u2019utilitaire de son Audacity G\u00e9n\u00e9rer un fichier son de une seconde un LA \u00e0 440 Hz fichier : la.c Pour compiler : pour \u00e9couter le fichier son g\u00e9n\u00e9r\u00e9\" \/>\n<meta property=\"og:url\" content=\"https:\/\/workboot.fr\/ciela\/open-close-2\/\" \/>\n<meta property=\"og:site_name\" content=\"workboot\" \/>\n<meta property=\"article:modified_time\" content=\"2025-11-26T15:09:16+00:00\" \/>\n<meta name=\"twitter:label1\" content=\"Dur\u00e9e de lecture estim\u00e9e\" \/>\n\t<meta name=\"twitter:data1\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/open-close-2\\\/\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/open-close-2\\\/\",\"name\":\"open \\\/ close - workboot\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#website\"},\"datePublished\":\"2025-11-26T14:57:46+00:00\",\"dateModified\":\"2025-11-26T15:09:16+00:00\",\"inLanguage\":\"fr-FR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/workboot.fr\\\/ciela\\\/open-close-2\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#website\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/\",\"name\":\"workboot\",\"description\":\"Open Source, Open Minds \",\"publisher\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"fr-FR\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#organization\",\"name\":\"workboot\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"fr-FR\",\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/logo_ciel-dorian-1.png\",\"contentUrl\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/wp-content\\\/uploads\\\/2025\\\/05\\\/logo_ciel-dorian-1.png\",\"width\":1024,\"height\":950,\"caption\":\"workboot\"},\"image\":{\"@id\":\"https:\\\/\\\/workboot.fr\\\/ciela\\\/#\\\/schema\\\/logo\\\/image\\\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"open \/ close - workboot","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/workboot.fr\/ciela\/open-close-2\/","og_locale":"fr_FR","og_type":"article","og_title":"open \/ close - workboot","og_description":"Installation de l\u2019utilitaire de son Audacity G\u00e9n\u00e9rer un fichier son de une seconde un LA \u00e0 440 Hz fichier : la.c Pour compiler : pour \u00e9couter le fichier son g\u00e9n\u00e9r\u00e9","og_url":"https:\/\/workboot.fr\/ciela\/open-close-2\/","og_site_name":"workboot","article_modified_time":"2025-11-26T15:09:16+00:00","twitter_misc":{"Dur\u00e9e de lecture estim\u00e9e":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/workboot.fr\/ciela\/open-close-2\/","url":"https:\/\/workboot.fr\/ciela\/open-close-2\/","name":"open \/ close - workboot","isPartOf":{"@id":"https:\/\/workboot.fr\/ciela\/#website"},"datePublished":"2025-11-26T14:57:46+00:00","dateModified":"2025-11-26T15:09:16+00:00","inLanguage":"fr-FR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/workboot.fr\/ciela\/open-close-2\/"]}]},{"@type":"WebSite","@id":"https:\/\/workboot.fr\/ciela\/#website","url":"https:\/\/workboot.fr\/ciela\/","name":"workboot","description":"Open Source, Open Minds ","publisher":{"@id":"https:\/\/workboot.fr\/ciela\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/workboot.fr\/ciela\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"fr-FR"},{"@type":"Organization","@id":"https:\/\/workboot.fr\/ciela\/#organization","name":"workboot","url":"https:\/\/workboot.fr\/ciela\/","logo":{"@type":"ImageObject","inLanguage":"fr-FR","@id":"https:\/\/workboot.fr\/ciela\/#\/schema\/logo\/image\/","url":"https:\/\/workboot.fr\/ciela\/wp-content\/uploads\/2025\/05\/logo_ciel-dorian-1.png","contentUrl":"https:\/\/workboot.fr\/ciela\/wp-content\/uploads\/2025\/05\/logo_ciel-dorian-1.png","width":1024,"height":950,"caption":"workboot"},"image":{"@id":"https:\/\/workboot.fr\/ciela\/#\/schema\/logo\/image\/"}}]}},"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"admin","author_link":"https:\/\/workboot.fr\/ciela\/author\/admin\/"},"uagb_comment_info":0,"uagb_excerpt":"Installation de l\u2019utilitaire de son Audacity G\u00e9n\u00e9rer un fichier son de une seconde un LA \u00e0 440 Hz fichier : la.c Pour compiler : pour \u00e9couter le fichier son g\u00e9n\u00e9r\u00e9","_links":{"self":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/5389","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/comments?post=5389"}],"version-history":[{"count":5,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/5389\/revisions"}],"predecessor-version":[{"id":5398,"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/pages\/5389\/revisions\/5398"}],"wp:attachment":[{"href":"https:\/\/workboot.fr\/ciela\/wp-json\/wp\/v2\/media?parent=5389"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}