{"payload":{"allShortcutsEnabled":false,"fileTree":{"database":{"items":[{"name":"img","path":"database/img","contentType":"directory"},{"name":"impulse-responses","path":"database/impulse-responses","contentType":"directory"},{"name":"learned-models","path":"database/learned-models","contentType":"directory"},{"name":"listening-tests","path":"database/listening-tests","contentType":"directory"},{"name":"pdf","path":"database/pdf","contentType":"directory"},{"name":"sound-databases","path":"database/sound-databases","contentType":"directory"},{"name":"stimuli","path":"database/stimuli","contentType":"directory"},{"name":"vision","path":"database/vision","contentType":"directory"},{"name":"index.txt","path":"database/index.txt","contentType":"file"},{"name":"usage.txt","path":"database/usage.txt","contentType":"file"}],"totalCount":10},"":{"items":[{"name":"_theme","path":"_theme","contentType":"directory"},{"name":"afe","path":"afe","contentType":"directory"},{"name":"amlttp","path":"amlttp","contentType":"directory"},{"name":"binsim","path":"binsim","contentType":"directory"},{"name":"blackboard","path":"blackboard","contentType":"directory"},{"name":"database","path":"database","contentType":"directory"},{"name":"dev","path":"dev","contentType":"directory"},{"name":"examples","path":"examples","contentType":"directory"},{"name":"img","path":"img","contentType":"directory"},{"name":"intro","path":"intro","contentType":"directory"},{"name":"robo","path":"robo","contentType":"directory"},{"name":".gitignore","path":".gitignore","contentType":"file"},{"name":"LICENSE","path":"LICENSE","contentType":"file"},{"name":"Makefile","path":"Makefile","contentType":"file"},{"name":"README.md","path":"README.md","contentType":"file"},{"name":"acronyms.py","path":"acronyms.py","contentType":"file"},{"name":"conf.py","path":"conf.py","contentType":"file"},{"name":"contents.txt","path":"contents.txt","contentType":"file"},{"name":"index.txt","path":"index.txt","contentType":"file"},{"name":"licenses.py","path":"licenses.py","contentType":"file"},{"name":"links.py","path":"links.py","contentType":"file"},{"name":"make.bat","path":"make.bat","contentType":"file"},{"name":"partner-locations.geojson","path":"partner-locations.geojson","contentType":"file"},{"name":"replacements.py","path":"replacements.py","contentType":"file"}],"totalCount":24}},"fileTreeProcessingTime":9.155425,"foldersToFetch":[],"repo":{"id":39072642,"defaultBranch":"master","name":"documentation","ownerLogin":"TWOEARS","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2015-07-14T12:09:16.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/5630065?v=4","public":true,"private":false,"isOrgOwned":true},"symbolsExpanded":false,"treeExpanded":true,"refInfo":{"name":"1.4","listCacheKey":"v0:1539286225.0","canEdit":false,"refType":"branch","currentOid":"c05d2bdfa79b72828d76ea38f2ab7f2ee2153aa1"},"path":"database/usage.txt","currentUser":null,"blob":{"rawLines":null,"stylingDirectives":null,"colorizedLines":null,"csv":null,"csvError":null,"dependabotInfo":{"showConfigurationBanner":false,"configFilePath":null,"networkDependabotPath":"/TWOEARS/documentation/network/updates","dismissConfigurationNoticePath":"/settings/dismiss-notice/dependabot_configuration_notice","configurationNoticeDismissed":null},"displayName":"usage.txt","displayUrl":"https://github.com/TWOEARS/documentation/blob/1.4/database/usage.txt?raw=true","headerInfo":{"blobSize":"2.61 KB","deleteTooltip":"You must be signed in to make or propose changes","editTooltip":"You must be signed in to make or propose changes","ghDesktopPath":"https://desktop.github.com","isGitLfs":false,"onBranch":true,"shortPath":"4814a46","siteNavLoginPath":"/login?return_to=https%3A%2F%2Fgithub.com%2FTWOEARS%2Fdocumentation%2Fblob%2F1.4%2Fdatabase%2Fusage.txt","isCSV":false,"isRichtext":true,"toc":[{"level":1,"text":"Usage","anchor":"usage","htmlText":"Usage"}],"lineInfo":{"truncatedLoc":"55","truncatedSloc":"43"},"mode":"file"},"image":false,"isCodeownersFile":null,"isPlain":false,"isValidLegacyIssueTemplate":false,"issueTemplate":null,"discussionTemplate":null,"language":"reStructuredText","languageID":419,"large":false,"planSupportInfo":{"repoIsFork":null,"repoOwnedByCurrentUser":null,"requestFullPath":"/TWOEARS/documentation/blob/1.4/database/usage.txt","showFreeOrgGatedFeatureMessage":null,"showPlanSupportBanner":null,"upgradeDataAttributes":null,"upgradePath":null},"publishBannersInfo":{"dismissActionNoticePath":"/settings/dismiss-notice/publish_action_from_dockerfile","releasePath":"/TWOEARS/documentation/releases/new?marketplace=true","showPublishActionBanner":false},"rawBlobUrl":"https://github.com/TWOEARS/documentation/raw/1.4/database/usage.txt","renderImageOrRaw":false,"richText":"

Usage

\n

As explained in the :ref:`sec-tutorial-database` tutorial the database is\nlocated at https://dev.qu.tu-berlin.de/projects/twoears-database, but you don't\nhave to download any files yourself as this is automatically performed by the\n|BinSim| or by explicitly calling db.getFile(), for example:

\n
filename = db.getFile('stimuli/anechoic/instruments/anechoic_cello.wav');\nsig = wavread(filename);
\n

All the data that is automatically downloaded is cached inside a temporary\nfolder. You can get the position of this folder by executing db.tmp() and\nchange it with db.tmp('/path/to/tmp'). If\nyou would like to clear the temporary folder you can execute db.clearTmp().\nBefore downloading a file from the remote database db.getFile() first looks\nif you have a file on your computer in the exact relative position as specified,\nin this case ./stimuli/anechoic/instruments/anechoic_cello.wav, then it will\nlook if you have a local copy of the database on your PC. The position of that\ndatabase can be specified or seen by the db.path function. After that it\nlooks inside the temporary cache for the file and only then downloads it.

\n

If you want to get an overview what files are present in database, you may copy\nthe output of db.url() and paste it into your web browser. As a second,\nmore Linux-like alternative you may call db.listDir('') in order to display\nthe content of the database's root directory. For other directories call e.g.\ndb.listDir('this/is/a/directory'). Listing the content of sub-directories\ncan be done by providing a second boolean argument, i.e.\ndb.listDir('this/is/a/directory', 1). For convenience, you can also download\nthe content for a whole directory with e.g.\ndb.getDir('this/is/a/directory', 1) with second parameter, again, specifying\nif you want to download the content of potential sub-directories. However,\ntake care, since you might request a lot of files.

\n

In the daily use of the |TwoEarsModel| you might even never directly use the\ndb.getFile() function as you specify files to use most likely inside a\nscene description file, see :ref:`sec-xml-scene-description`. For example, in\norder to use the same |HRTF| from above you have to add the following address to\nyour scene configuration:

\n
<scene HRIRs=\"impulse_responses/qu_kemar_anechoic/QU_KEMAR_anechoic_3m.sofa\">
\n

The |BinSim| will then automatically call the db.getFile() function in\norder to get the desired |HRTF|.

\n

To see further examples, you might want to look at\n:ref:`sec-impulse-responses-usage`.

\n\n
","renderedFileInfo":null,"shortPath":null,"symbolsEnabled":true,"tabSize":8,"topBannersInfo":{"overridingGlobalFundingFile":false,"globalPreferredFundingPath":null,"showInvalidCitationWarning":false,"citationHelpUrl":"https://docs.github.com/github/creating-cloning-and-archiving-repositories/creating-a-repository-on-github/about-citation-files","actionsOnboardingTip":null},"truncated":false,"viewable":true,"workflowRedirectUrl":null,"symbols":{"timed_out":false,"not_analyzed":true,"symbols":[]}},"copilotInfo":null,"copilotAccessAllowed":false,"csrf_tokens":{"/TWOEARS/documentation/branches":{"post":"Nyj5oAd2PU7j5PoG1vKOv2nbynRM5itN1j-rQoD3bu2xLAVBGvmwQIDyIbrRkzo5H-q6k1_JsH-_34aYPXvG4A"},"/repos/preferences":{"post":"zs1xDqVzgcX6Q-mLwodO43WWetGrZBV845yiRH_SX_fxysclrPMR-MH6pwmBvfwzQM9dINelIoQjqX1v5BWohw"}}},"title":"documentation/database/usage.txt at 1.4 ยท TWOEARS/documentation"}