Skip to content

Commit

Permalink
remove mechanism after playing the audio file
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmuhtasimfuadfahim committed Aug 21, 2024
1 parent 309b1ba commit 95c3020
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 5 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to the `lovemate` package will be documented in this file.

## [1.0.4] - 2024-08-21

### Improved

- Removed the mechanism for deleting the `lovemate-voice.mp3` file after it has been played.

## [1.0.2] - 2024-06-10

### Added
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "lovemate",
"version": "1.0.3",
"version": "1.0.4",
"description": "A package that says affectionate phrases in various languages.",
"main": "src/index.js",
"repository": {
Expand Down Expand Up @@ -33,4 +33,4 @@
"devDependencies": {
"eslint": "^9.4.0"
}
}
}
8 changes: 8 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ const lovemateVoice = async (language = 'en-US') => {
console.error('Error playing the sound:', err);
return;
}

// Delete the file after playing
fs.unlink(filePath, (err) => {
if (err) {
console.error('Error deleting the file:', err);
return;
}
});
});

// Return the text and the URL
Expand Down

1 comment on commit 95c3020

@salekin02
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice work

Please sign in to comment.