Electronic apparatus for outputting audio from multiple sources and control method thereof
An electronic apparatus is disclosed. The electronic apparatus includes a communication interface and a processor configured to control, based on a signal corresponding to a play start of a first audio being received from a first device through the communication interface, to output the first audio received from the first device, end, based on a signal corresponding to a play start of a second audio being received from a second device through the communication interface while the first audio is being output, an output of the first audio and control to output the second audio received from the second device, transmit, based on an output of the second audio being ended, a signal requesting playing of the first audio to the first device through the communication interface, and control, based on the signal corresponding to the play start of the first audio corresponding to the signal requesting the playing of the first audio being received, to output the first audio received from the first device.
1 . An electronic apparatus comprising:
a communication interface;
memory storing instructions; and
at least one processor,
wherein the instructions, when executed by the at least one processor, cause the electronic apparatus to:
based on first audio data and a first play start signal corresponding to the first audio data being received from a first device through the communication interface, cause the first audio data to be output,
based on second audio data and a second play start signal corresponding to the second audio data being received from a second device through the communication interface while the first audio data is being output, cause the output of the first audio data to stop and cause the second audio data to be output,
based on the output of the second audio data ending, transmit a signal requesting playing of the first audio data to the first device through the communication interface,
based on a second first play start signal being received through the communication interface subsequent to the transmitting of the signal requesting playing of the first audio data, cause the first audio data to be output,
based on a play stop signal corresponding to the second audio data being received from the second device through the communication interface within a first time from when the output of the second audio data is started, cause the output of the second audio data to stop,
based on the second play start signal and the second audio data being received from the second device through the communication interface, identify whether the second audio data is an alarm type based on at least one from among the second audio data or history information corresponding to the second device,
based on the second audio data being identified as the alarm type, identify whether the play stop signal is received from the second device through the communication interface during the first time, and
based on identifying that the play stop signal was received during the first time, transmit the signal requesting the playing of the first audio data to the first device through the communication interface.
2 . The electronic apparatus of claim 1 , wherein the memory further stores at least one from among history information corresponding to a device or audio duration time information corresponding to a plurality of application types, and
wherein the instructions, when executed by the at least one processor, further cause the electronic apparatus to:
based on the play stop signal being received through the communication interface during the first time and based on at least one from among the history information or the audio duration time information, cause the output of the second audio data to stop and transmit the signal requesting the playing of the first audio data to the first device through the communication interface.
3 . The electronic apparatus of claim 2 ,
wherein the instructions, when executed by the at least one processor, further cause the electronic apparatus to:
identify, based on the second play start signal being received from the second device through the communication interface while the first audio data is being output, type information of an application from among the plurality of application types corresponding to the second audio data, and
identify, based on the identified type information of the application and the -audio duration time information, a duration of the first time.
4 . The electronic apparatus of claim 1 , further comprising:
a user interface,
wherein the instructions, when executed by the at least one processor, further cause the electronic apparatus to:
identify, based on a user input received through the user interface, a duration of the first time.
5 . The electronic apparatus of claim 1 , wherein the memory further stores a trained neural network model, and
wherein the instructions, when executed by the at least one processor, is further cause the electronic apparatus to:
identify whether the second audio data is the alarm type by inputting the second audio data into the trained neural network model.
6 . The electronic apparatus of claim 1 , wherein the instructions, when executed by the at least one processor, is further cause the electronic apparatus to:
based on receiving, through the communication interface, a signal corresponding to a same type as the second play start signal a number of times that is greater than or equal to a pre-set number of times during a time interval from when the second play start signal is received from the second device, cause the output of the second audio data to stop.
7 . The electronic apparatus of claim 1 , further comprising:
an outputter,
wherein the instructions, when executed by the at least one processor, further cause the electronic apparatus to:
based on the first play start signal being received from the first device through the communication interface, output the first audio data through the outputter,
based on the second play start signal being the alarm type and being received from the second device through the communication interface while the first audio data is being output, output the second audio data through the outputter, and
based on the second first play start signal being received through the communication interface in response to the signal requesting playing of the first audio data, output the first audio data through the outputter.
8 . The electronic apparatus of claim 1 , wherein the instructions, when executed by the at least one processor, further cause the electronic apparatus to:
based on the first play start signal being received through the communication interface in response to the signal requesting playing of the first audio data, cause the first audio data to be output from a second play time point in the first audio data that precedes, by a pre-set time interval, a first play time point corresponding to a play time point in the first audio data when the output of the first audio data was stopped.
9 . A method of controlling an electronic apparatus, the method comprising:
based on first audio data and a first play start signal corresponding to the first audio data being received from a first device, outputting the first audio data;
based on second audio data and a second play start signal corresponding to the second audio data being received from a second device while the first audio data is being output, stopping the outputting of the first audio data and outputting the second audio data;
based on the outputting of the second audio data ending, transmitting a signal requesting playing of the first audio data to the first device; and
based on the first play start signal being received subsequent to the transmitting of the signal requesting the playing of the first audio data, outputting the first audio data,
wherein the transmitting the signal requesting the playing of the first audio data comprises:
based on a play stop signal corresponding to the second audio data being received from the second device within a first time from when the output of the second audio data is started, ending the outputting of the second audio data, and
wherein the method further comprises:
based on the second play start signal and the second audio data being received from the second device, identifying whether the second audio data is an alarm type based on at least one from among the second audio data or history information corresponding to the second device;
based on the second audio data being identified as the alarm type, identifying whether the play stop signal is received from the second device during the first time; and
based on identifying that the play stop signal was received during the first time, transmitting the signal requesting the playing of the first audio data to the first device.
10 . The method of claim 9 , wherein the transmitting the signal requesting the playing of the first audio data further comprises:
based on the play stop signal being received from the second device during the first time and based on at least one from among history information corresponding to a device stored in a memory of the electronic apparatus or audio duration time information corresponding to a plurality of application types stored in the memory, stopping the outputting of the second audio data and transmitting the signal requesting the playing of the first audio data to the first device.
11 . The method of claim 10 , further comprising:
identifying, based on the second play start signal being received from the second device while the first audio data is being output, type information of an application from among the plurality of application types corresponding to the second audio data; and
identifying, based on the identified type information of the application and the audio duration time information, a duration of the first time.
12 . The method of claim 9 , further comprising:
based on the first play start signal being received in response to the signal requesting playing of the first audio data, causing the first audio data to be output from a second play time point in the first audio data that precedes, by a pre-set time interval, a first play time point corresponding to a play time point in the first audio data when the output of the first audio data was stopped.
13 . A non-transitory computer-readable recording medium having instructions stored therein, which when executed by at least one processor cause the at least one processor to execute a method of controlling an electronic apparatus, the method comprising:
based on first audio data and a first play start signal corresponding to the first audio data being received from a first device, outputting the first audio data;
based on second audio data and a second play start signal corresponding to the second audio data being received from a second device while the first audio data is being output, stopping the outputting of the first audio data and outputting the second audio data;
based on the outputting of the second audio data ending, transmitting a signal requesting playing of the first audio data to the first device; and
based on the first play start signal being received subsequent to the transmitting of the signal requesting the playing of the first audio data, outputting the first audio data,
wherein the transmitting the signal requesting the playing of the first audio data comprises:
based on a play stop signal corresponding to the second audio data being received from the second device within a first time from when the output of the second audio data is started, ending the outputting of the second audio data, and
wherein the method further comprises:
based on the second play start signal and the second audio data being received from the second device, identifying whether the second audio data is an alarm type based on at least one from among the second audio data or history information corresponding to the second device;
based on the second audio data being identified as the alarm type, identifying whether the play stop signal is received from the second device during the first time; and
based on identifying that the play stop signal was received during the first time, transmitting the signal requesting the playing of the first audio data to the first device.
14 . The non-transitory computer-readable recording medium of claim 13 , wherein the transmitting the signal requesting the playing of the first audio data further comprises:
based on the play stop signal being received from the second device during the first time and based on at least one from among history information corresponding to a device stored in a memory of the electronic apparatus or audio duration time information corresponding to a plurality of application types stored in the memory, stopping the outputting of the second audio data and transmitting the signal requesting the playing of the first audio data to the first device.
15 . The non-transitory computer-readable recording medium of claim 14 , wherein the method further comprises:
identifying, based on the second play start signal being received from the second device while the first audio data is being output, type information of an application from among the plurality of application types corresponding to the second audio data; and
identifying, based on the identified type information of the application and the audio duration time information, a duration of the first time.