PHP code example of remithefox / morse

1. Go to this page and download the library: Download remithefox/morse library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

remithefox / morse example snippets


use RemiTheFox\Wave\Wave;

$builder = Wave::builder()
    ->setNumberOfChannels(1)
    ->setSampleRate(44100)
    ->setBitsPerSample(8)
    ->setFloatDecorator(true);

$wave = $builder->create(__DIR__ . '/sound.wav');

use RemiTheFox\Morse\MorseEncoder;

// ...

$morse = new MorseEncoder($wave, [0], 20, 700, 1);

// ...

$morse->text('CQ CQ SO9FOX');

// ...

$morse->space();

// ...

$morse->attention();

// ...

$morse->text('<SOS> CQ CQ SO9FOX');

// ...

$morse->setShortNumbers(true);
$morse->setShortNumbers(false);

// ...

$morse
    ->text('CQ CQ SO9FOX CALL ME')
    ->space()
    ->setShortNumbers(true)
    ->text('501 234 567')
    ->setShortNumbers(false);
text
 /\-/\
(=^w^=)
 )   (