Private
authPrivate
clientPrivate
clientPrivate
hostPrivate
urisPrivate
CollectionPrivate
PackPrivate
PackPrivate
SoundPrivate
SoundPrivate
UserPrivate
checkSearch sounds in Freesound based on their content descriptors. See https://freesound.org/docs/api/resources_apiv2.html#content-search for more information.
const result = await freeSound.contentSearch({
target: 'lowlevel.pitch.mean:220',
});
Describe a previously uploaded file that does not have a description. Note: after a sound receives a description, the team of Freesound moderators still needs to process and moderate it, so it may not yet appear in Freesound. A list of sounds uploaded and described by the user, but still pending processing and moderation, is viewable with the getPendingSounds() method. This method requires OAuth2 authentication. See https://freesound.org/docs/api/resources_apiv2.html#describe-sound-oauth2-required for more information.
a description for an uploaded sound
Private
fetchRetrieve the list of sounds included in a pack. See https://freesound.org/docs/api/resources_apiv2.html#pack-sounds for more information.
a list of sounds included in the pack that has packId as its identification number
// Fetch the pack
// https://freesound.org/people/vroomvro0om/packs/21143/.
const packObj = await freeSound.getPack(21143);
the identification number of the pack to fetch
Retrieve a list of audio files uploaded by he Freesound user logged in using OAuth2 are not described, processed or moderated. In Freesound, sounds need descriptions after their upload. Then, sounds are automatically processed, and, finally, a team of human moderators either accepts or rejects the upload. This method keeps track of the status of these uploads and requires OAuth2 authentication. See https://freesound.org/docs/api/resources_apiv2.html#pending-uploads-oauth2-required for more information.
const result = await freeSound.getPendingSounds()
Retrieve detailed information about a sound. See https://freesound.org/docs/api/resources_apiv2.html#sound-resources for more information.
detailed information about a sound
// Fetch the sound
// https://freesound.org/people/vroomvro0om/sounds/376626/.
const fetchedSound = await freeSound.getSound(376626);
the identification number of the sound
Retrieve information about a particular Freesound user. See https://freesound.org/docs/api/resources_apiv2.html#user-instance for more information.
information about a particular Freesound user
// Get information about the user https://freesound.org/people/MTG/.
const user = await freeSound.getUser('MTG');
the username of the Freesound user
Private
makePrivate
makePrivate
makeThis method allows you to get a new token using a refresh token or an auth token
await freeSound.postAccessCode('your-temporary-code-from-login');
Set the credentials supplied by https://freesound.org/apiv2/apply for API call authentication. See https://freesound.org/docs/api/authentication.html?highlight=secret#token-authentication for more information.
your client ID, obtainable at https://freesound.org/apiv2/apply
your client secret, obtainable at https://freesound.org/apiv2/apply
await freeSound.setClientSecrets(
"your-client-id",
"your-secret-key"
);
There are two ways of authenticating: OAuth and token method. The OAuth method is required for more privilidged actions such as downloading sounds.
This method can set both kinds of tokens
await freeSound.setToken('your-api-key', 'oauth');
Optional
type: "oauth"Search sounds in Freesound by matching their tags and other kinds of metadata. See https://freesound.org/docs/api/resources_apiv2.html#sound-text-search for more information.
await freeSound.textSearch('violoncello', {
page: 1,
filter: 'tag:tenuto duration:[1.0 TO 15.0]',
sort: 'rating_desc',
fields: 'id,name,url'
});
Upload an audio file into Freesound and optionally describe it. If there is no file description, only the audio file will upload, and the user will need to add a description later using the describe(description: { description: string }) method. If the file description is present, the uploaded file will be ready for the processing and moderation stage. A list of uploaded files pending a description, processing or moderation is obtainable through the getPendingSounds() method. See https://freesound.org/docs/api/resources_apiv2.html#upload-sound-oauth2-required for more information. This method requires OAuth2 authentication.
the audio file to upload
the name of the audio file to upload
the description of the audio file to upload
Generated using TypeDoc
Search sounds in Freesound based on their tags, metadata and content-based descriptiors via a combination of text search and content search. See https://freesound.org/docs/api/resources_apiv2.html#combined-search for more information.