Skip to content

Commit

Permalink
Updated tour
Browse files Browse the repository at this point in the history
fixed samplerate for wavesurfer audio
  • Loading branch information
Mattk70 committed Jan 26, 2024
1 parent 80ccb19 commit 85ed82a
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 81 deletions.
40 changes: 23 additions & 17 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
</div>
</div>
<!-- The modal for the tour -->
<div class="modal modal-fade" id="tourModal" tabindex="-1" aria-labelledby="tourModalLabel" aria-hidden="true">
<div class="modal modal-lg modal-fade" id="tourModal" tabindex="-1" aria-labelledby="tourModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-body">
Expand All @@ -63,16 +63,21 @@
<img src="img/logo/chirpity_logo2.png" class="w-100 rounded pb-4" alt="Chiprity Nocmig">
<div class="text-center pb-4">
<h5>Welcome to Chirpity Nocmig</h5>
<p>This tour will highlight a few of the key features of the application.</p>
<p>This tour will highlight a few of the key features of the application. Click the right arrow for the next item</p>
</div>
</div>
<div class="carousel-item" data-element-selector="#navbarSettings">
<img src="img/logo/chirpity_logo2.png" class="w-100 rounded pb-4" alt="Chiprity Nocmig">
<div class="text-center pb-4">
<h5>Settings</h5>
<p>When getting started, here is where you should set a number of default settings, especially your recording location.
You may also want to tune system parameters, audio preferences and spectrogram options.
</p>
<div class="text-start pb-4 ms-3">
<h5 class="text-center">Getting Started</h5>
<ol class="ps-5 ms-5">
<li>First off, set your location in the settings menu.</li>
<li>Next, consider which model best suits your needs:</li>
<ul>
<li><b>Chirpity</b> is tuned for nocturnal migration,<br> but only has birds on the British list</li>
<li><b>BirdNET</b> is trained on global bird species</li>
</ul>
</ol>
</div>
</div>
<div class="carousel-item" data-element-selector="#filter-panel">
Expand All @@ -81,16 +86,17 @@ <h5>Settings</h5>
<h5>Quick access settings panel</h5>
<p>The icons here allow you to qucikly toggle some frequently used settings.
These include:
<ul>
<li>Nocmig mode
<li>Audio filters
<li>Context-aware mode
<li>Which detection list to use
<li>Fullscreen mode for the spectrogram
<li>And the confidence threshold.
</ul>
Note, the confidence threshold can be adjusted at any time,
even after a file analysis has taken place.
<div class="w-75 ms-5">
<ol class="text-start ps-5">
<li>Nocmig mode
<li>Audio filters
<li>Context-aware mode
<li>Fullscreen mode for the spectrogram
<li>Which detection list to use
<li>And the confidence threshold.
</ol>
</div>
Explanations for each of these settings can be found under "Settings" in the Help menu.
</p>
</div>
</div>
Expand Down
134 changes: 72 additions & 62 deletions js/BirdNet2.4.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,78 @@ let BACKEND;
//GLOBALS
let myModel;
// const MIGRANTS = new Set(["Pluvialis dominica_American Golden Plover", "Acanthis hornemanni_Arctic Redpoll", "Sterna paradisaea_Arctic Tern", "Recurvirostra avosetta_Avocet", "Porzana pusilla_Baillon's Crake", "Limosa lapponica_Bar-tailed Godwit", "Tyto alba_Barn Owl", "Branta leucopsis_Barnacle Goose", "Cygnus columbianus_Bewick's Swan", "Botaurus stellaris_Bittern", "Chroicocephalus ridibundus_Black-headed Gull", "Podiceps nigricollis_Black-necked Grebe", "Limosa limosa_Black-tailed Godwit", "Turdus merula_Blackbird", "Sylvia atricapilla_Blackcap", "Fringilla montifringilla_Brambling", "Branta bernicla_Brent Goose", "Branta canadensis_Canada Goose", "Larus cachinnans_Caspian Gull", "Phylloscopus collybita_Chiffchaff", "Loxia curvirostra_Common Crossbill", "Larus canus_Common Gull", "Acanthis flammea_Common Redpoll", "Actitis hypoleucos_Common Sandpiper", "Melanitta nigra_Common Scoter", "Sterna hirundo_Common Tern", "Fulica atra_Coot", "Crex crex_Corncrake", "Cuculus canorus_Cuckoo", "Calidris ferruginea_Curlew Sandpiper", "Numenius arquata_Curlew", "Charadrius morinellus_Dotterel", "Calidris alpina_Dunlin", "Prunella modularis_Dunnock", "Alopochen aegyptiaca_Egyptian Goose", "Turdus pilaris_Fieldfare", "Mareca strepera_Gadwall", "Sylvia borin_Garden Warbler", "Spatula querquedula_Garganey", "Regulus regulus_Goldcrest", "Pluvialis apricaria_Golden Plover", "Bucephala clangula_Goldeneye", "Mergus merganser_Goosander", "Locustella naevia_Grasshopper Warbler", "Larus marinus_Great Black-backed Gull", "Podiceps cristatus_Great Crested Grebe", "Tringa ochropus_Green Sandpiper", "Tringa nebularia_Greenshank", "Ardea cinerea_Grey Heron", "Perdix perdix_Grey Partridge", "Phalaropus fulicarius_Grey", "Pluvialis squatarola_Grey Plover", "Motacilla cinerea_Grey Wagtail ", "Anser anser_Greylag Goose", "Delichon urbicum_House Martin", "Coccothraustes coccothraustes_Hawfinch", "Larus argentatus_Herring Gull", "Lymnocryptes minimus_Jack Snipe", "Alcedo atthis_Kingfisher", "Calidris canutus_Knot", "Calcarius lapponicus_Lapland Bunting", "Larus fuscus_Lesser Black-backed Gull", "Acanthis cabaret_Lesser Redpoll ", "Sylvia curruca_Lesser Whitethroat", "Linaria cannabina_Linnet", "Egretta garzetta_Little Egret", "Tachybaptus ruficollis_Little Grebe", "Hydrocoloeus minutus_Little Gull", "Athene noctua_Little Owl", "Charadrius dubius_Little Ringed Plover", "Calidris minuta_Little Stint ", "Sternula albifrons_Little Tern", "Asio otus_Long-eared Owl", "Clangula hyemalis_Long-tailed Duck", "Anas platyrhynchos_Mallard", "Aix galericulata_Mandarin Duck", "Anthus pratensis_Meadow Pipit", "Ichthyaetus melanocephalus_Mediterranean Gull", "Turdus viscivorus_Mistle Thrush", "Gallinula chloropus_Moorhen", "Nycticorax nycticorax_Night Heron", "Luscinia megarhynchos_Nightingale", "Luscinia megarhynchos_Nightingale (song)", "Caprimulgus europaeus_Nightjar", "Anthus hodgsoni_Olive-backed Pipit", "Emberiza hortulana_Ortolan Bunting", "Emberiza pusilla_Little Bunting", "Haematopus ostralegus_Oystercatcher", "Ficedula hypoleuca_Pied Flycatcher", "Motacilla alba_Pied Wagtail", "Anser brachyrhynchus_Pink-footed Goose", "Anas acuta_Pintail", "Aythya ferina_Pochard", "Calidris maritima_Purple Sandpiper", "Coturnix coturnix_Quail", "Mergus serrator_Red-breasted Merganser", "Netta rufina_Red-crested Pochard", "Alectoris rufa_Red-legged Partridge", "Tringa totanus_Redshank", "Phoenicurus phoenicurus_Redstart", "Turdus iliacus_Redwing", "Emberiza schoeniclus_Reed Bunting", "Acrocephalus scirpaceus_Reed Warbler", "Turdus torquatus_Ring Ouzel", "Charadrius hiaticula_Ringed Plover", "Erithacus rubecula_Robin (flight call)", "Anthus petrosus_Rock Pipit", "Sterna dougallii_Roseate Tern", "Calidris pugnax_Ruff", "Riparia riparia_Sand Martin", "Calidris alba_Sanderling", "Thalasseus sandvicensis_Sandwich Tern", "Aythya marila_Scaup", "Loxia scotica_Scottish Crossbill", "Acrocephalus schoenobaenus_Sedge Warbler", "Tadorna tadorna_Shelduck", "Asio flammeus_Short-eared Owl", "Spatula clypeata_Shoveler", "Spinus spinus_Siskin", "Alauda arvensis_Skylark", "Gallinago gallinago_Snipe", "Plectrophenax nivalis_Snow Bunting", "Turdus philomelos_Song Thrush", "Porzana porzana_Spotted Crake", "Muscicapa striata_Spotted Flycatcher", "Tringa erythropus_Spotted Redshank", "Burhinus oedicnemus_Stone-curlew", "Saxicola rubicola_Stonechat", "Hirundo rustica_Swallow", "Apus apus_Swift", "Anser fabalis_Taiga Bean Goose", "Strix aluco_Tawny Owl", "Anas crecca_Teal", "Anthus trivialis_Tree Pipit", "Aythya fuligula_Tufted Duck", "Anser serrirostris_Tundra Bean Goose", "Arenaria interpres_Turnstone", "Anthus spinoletta_Water Pipit", "Rallus aquaticus_Water Rail", "Numenius phaeopus_Whimbrel", "Anser albifrons_White-fronted Goose", "Sylvia communis_Whitethroat", "Cygnus cygnus_Whooper Swan", "Mareca penelope_Wigeon", "Phylloscopus trochilus_Willow Warbler", "Tringa glareola_Wood Sandpiper", "Scolopax rusticola_Woodcock", "Lullula arborea_Woodlark", "Larus michahellis_Yellow-legged Gull", "Motacilla flava_Yellow Wagtail", "Emberiza citrinella_Yellowhammer"]);
const NOT_BIRDS = ['Dog_Dog', 'Environmental_Environmental', 'Engine_Engine', 'Fireworks_Fireworks',
'Gryllus assimilis_Gryllus assimilis', 'Gun_Gun', 'Human non-vocal_Human non-vocal', 'Human vocal_Human vocal',
'Human whistle_Human whistle', 'Miogryllus saussurei_Miogryllus saussurei', 'Noise_Noise',
'Power tools_Power tools', 'Siren_Siren',"Canis latrans_Coyote",
"Canis lupus_Gray Wolf",
"Gastrophryne carolinensis_Eastern Narrow-mouthed Toad",
"Gastrophryne olivacea_Great Plains Narrow-mouthed Toad",
"Incilius valliceps_Gulf Coast Toad",
"Anaxyrus americanus_American Toad",
"Anaxyrus canorus_Yosemite Toad",
"Anaxyrus cognatus_Great Plains Toad",
"Anaxyrus fowleri_Fowler's Toad",
"Anaxyrus houstonensis_Houston Toad",
"Anaxyrus microscaphus_Arizona Toad",
"Anaxyrus quercicus_Oak Toad",
"Anaxyrus speciosus_Texas Toad",
"Anaxyrus terrestris_Southern Toad",
"Anaxyrus woodhousii_Woodhouse's Toad",
"Dryophytes andersonii_Pine Barrens Treefrog",
"Dryophytes arenicolor_Canyon Treefrog",
"Dryophytes avivoca_Bird-voiced Treefrog",
"Dryophytes chrysoscelis_Cope's Gray Treefrog",
"Dryophytes cinereus_Green Treefrog",
"Dryophytes femoralis_Pine Woods Treefrog",
"Dryophytes gratiosus_Barking Treefrog",
"Dryophytes squirellus_Squirrel Treefrog",
"Dryophytes versicolor_Gray Treefrog",
"Eleutherodactylus planirostris_Greenhouse Frog",
"Hyliola regilla_Pacific Chorus Frog",
"Lithobates catesbeianus_American Bullfrog",
"Lithobates clamitans_Green Frog",
"Lithobates palustris_Pickerel Frog",
"Lithobates sylvaticus_Wood Frog",
"Pseudacris brimleyi_Brimley's Chorus Frog",
"Pseudacris clarkii_Spotted Chorus Frog",
"Pseudacris crucifer_Spring Peeper",
"Pseudacris feriarum_Upland Chorus Frog",
"Pseudacris nigrita_Southern Chorus Frog",
"Pseudacris ocularis_Little Grass Frog",
"Pseudacris ornata_Ornate Chorus Frog",
"Pseudacris streckeri_Strecker's Chorus Frog",
"Pseudacris triseriata_Striped Chorus Frog",
"Acris crepitans_Northern Cricket Frog",
"Acris gryllus_Southern Cricket Frog",
"Eunemobius carolinus_Carolina Ground Cricket",
"Eunemobius confusus_Confused Ground Cricket",
"Gryllus assimilis_Gryllus assimilis",
"Gryllus fultoni_Southern Wood Cricket",
"Gryllus pennsylvanicus_Fall Field Cricket",
"Gryllus rubens_Southeastern Field Cricket",
"Neonemobius cubensis_Cuban Ground Cricket",
"Oecanthus celerinictus_Fast-calling Tree Cricket",
"Oecanthus exclamationis_Davis's Tree Cricket",
"Oecanthus fultoni_Snowy Tree Cricket",
"Oecanthus nigricornis_Blackhorned Tree Cricket",
"Oecanthus niveus_Narrow-winged Tree Cricket",
"Oecanthus pini_Pine Tree Cricket",
"Oecanthus quadripunctatus_Four-spotted Tree Cricket",
"Orocharis saltator_Jumping Bush Cricket",
"Alouatta pigra_Mexican Black Howler Monkey",
"Tamias striatus_Eastern Chipmunk",
"Tamiasciurus hudsonicus_Red Squirrel"];
const NOT_BIRDS = [
'Dog_Dog',
'Environmental_Environmental',
'Engine_Engine',
'Fireworks_Fireworks',
'Gun_Gun',
'Human non-vocal_Human non-vocal',
'Human vocal_Human vocal',
'Human whistle_Human whistle',
'Miogryllus saussurei_Miogryllus saussurei',
'Noise_Noise',
'Power tools_Power tools',
'Siren_Siren',
"Canis latrans_Coyote",
"Canis lupus_Gray Wolf",
"Gastrophryne carolinensis_Eastern Narrow-mouthed Toad",
"Gastrophryne olivacea_Great Plains Narrow-mouthed Toad",
"Incilius valliceps_Gulf Coast Toad",
"Anaxyrus americanus_American Toad",
"Anaxyrus canorus_Yosemite Toad",
"Anaxyrus cognatus_Great Plains Toad",
"Anaxyrus fowleri_Fowler's Toad",
"Anaxyrus houstonensis_Houston Toad",
"Anaxyrus microscaphus_Arizona Toad",
"Anaxyrus quercicus_Oak Toad",
"Anaxyrus speciosus_Texas Toad",
"Anaxyrus terrestris_Southern Toad",
"Anaxyrus woodhousii_Woodhouse's Toad",
"Dryophytes andersonii_Pine Barrens Treefrog",
"Dryophytes arenicolor_Canyon Treefrog",
"Dryophytes avivoca_Bird-voiced Treefrog",
"Dryophytes chrysoscelis_Cope's Gray Treefrog",
"Dryophytes cinereus_Green Treefrog",
"Dryophytes femoralis_Pine Woods Treefrog",
"Dryophytes gratiosus_Barking Treefrog",
"Dryophytes squirellus_Squirrel Treefrog",
"Dryophytes versicolor_Gray Treefrog",
"Eleutherodactylus planirostris_Greenhouse Frog",
"Hyliola regilla_Pacific Chorus Frog",
"Lithobates catesbeianus_American Bullfrog",
"Lithobates clamitans_Green Frog",
"Lithobates palustris_Pickerel Frog",
"Lithobates sylvaticus_Wood Frog",
"Pseudacris brimleyi_Brimley's Chorus Frog",
"Pseudacris clarkii_Spotted Chorus Frog",
"Pseudacris crucifer_Spring Peeper",
"Pseudacris feriarum_Upland Chorus Frog",
"Pseudacris nigrita_Southern Chorus Frog",
"Pseudacris ocularis_Little Grass Frog",
"Pseudacris ornata_Ornate Chorus Frog",
"Pseudacris streckeri_Strecker's Chorus Frog",
"Pseudacris triseriata_Striped Chorus Frog",
"Acris crepitans_Northern Cricket Frog",
"Acris gryllus_Southern Cricket Frog",
"Eunemobius carolinus_Carolina Ground Cricket",
"Eunemobius confusus_Confused Ground Cricket",
"Gryllus assimilis_Gryllus assimilis",
"Gryllus fultoni_Southern Wood Cricket",
"Gryllus pennsylvanicus_Fall Field Cricket",
"Gryllus rubens_Southeastern Field Cricket",
"Neonemobius cubensis_Cuban Ground Cricket",
"Oecanthus celerinictus_Fast-calling Tree Cricket",
"Oecanthus exclamationis_Davis's Tree Cricket",
"Oecanthus fultoni_Snowy Tree Cricket",
"Oecanthus nigricornis_Blackhorned Tree Cricket",
"Oecanthus niveus_Narrow-winged Tree Cricket",
"Oecanthus pini_Pine Tree Cricket",
"Oecanthus quadripunctatus_Four-spotted Tree Cricket",
"Orocharis saltator_Jumping Bush Cricket",
"Alouatta pigra_Mexican Black Howler Monkey",
"Tamias striatus_Eastern Chipmunk",
"Tamiasciurus hudsonicus_Red Squirrel"];
const MYSTERIES = ['Unknown Sp._Unknown Sp.'];
const GRAYLIST = [];
const GOLDEN_LIST = []
Expand Down
5 changes: 3 additions & 2 deletions js/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1037,7 +1037,8 @@ const convertTimeToBytes = (time, metadata) => {
}


async function setupCtx(chunk, header) {
async function setupCtx(chunk, header, sampleRate) {
sampleRate ??= STATE.sampleRate;
// Deal with detached arraybuffer issue
let audioBufferChunk;
try {
Expand Down Expand Up @@ -1253,7 +1254,7 @@ const fetchAudioBuffer = async ({
readStream.on('data', async chunk => {
// Ensure data is processed in order
readStream.pause();
const offlineCtx = await setupCtx(chunk, metadata[file].header);
const offlineCtx = await setupCtx(chunk, metadata[file].header, sampleRate);
if (offlineCtx){
offlineCtx.startRendering().then(resampled => {
// `resampled` contains an AudioBuffer resampled at 24000Hz.
Expand Down

0 comments on commit 85ed82a

Please sign in to comment.