WO2021036868A1 - Audio cutting position determination method and apparatus, electronic device, and storage medium - Google Patents

Audio cutting position determination method and apparatus, electronic device, and storage medium Download PDF

Info

Publication number
WO2021036868A1
WO2021036868A1 PCT/CN2020/109842 CN2020109842W WO2021036868A1 WO 2021036868 A1 WO2021036868 A1 WO 2021036868A1 CN 2020109842 W CN2020109842 W CN 2020109842W WO 2021036868 A1 WO2021036868 A1 WO 2021036868A1
Authority
WO
WIPO (PCT)
Prior art keywords
audio
cropped
bar
waveform
cropping
Prior art date
Application number
PCT/CN2020/109842
Other languages
French (fr)
Chinese (zh)
Inventor
沈卓彦
刘粤
Original Assignee
Oppo广东移动通信有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Oppo广东移动通信有限公司 filed Critical Oppo广东移动通信有限公司
Publication of WO2021036868A1 publication Critical patent/WO2021036868A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/60Information retrieval; Database structures therefor; File system structures therefor of audio data
    • G06F16/64Browsing; Visualisation therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04847Interaction techniques to control parameter settings, e.g. interaction with sliders or dials
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/0485Scrolling or panning

Definitions

  • This application relates to the technical field of electronic equipment, and more specifically, to a method, apparatus, electronic equipment, and storage medium for determining an audio cutting position.
  • this application proposes a method, device, electronic device and storage medium for determining the audio cutting position to solve the above-mentioned problems.
  • an embodiment of the present application provides a method for determining an audio cropping position, the method includes: displaying an audio cropping interface and playing the audio to be cropped, the audio cropping interface including waveforms and waveforms corresponding to the audio to be cropped The associated playback progress bar in the waveform; when a crop position setting instruction is received, the current position of the playback progress bar in the waveform is determined, the current position is taken as the first position, and the current position is in the first position.
  • an embodiment of the present application provides a device for determining an audio cutting position.
  • the device includes: an interface display module for displaying an audio cutting interface and playing the audio to be cut, the audio cutting interface includes The waveform corresponding to the clipped audio and the associated playback progress bar in the waveform; the first position determining module is used to determine the current position of the playback progress bar in the waveform when the clipping position setting instruction is received, and The current position is used as the first position and an audio cropping bar is added at the first position; the second position adjustment module is configured to adjust the playback progress bar to the desired position in the waveform when a playback adjustment instruction is received.
  • a cropping bar dragging module for receiving a drag operation acting on the audio cropping bar, and cutting the audio cropping bar in the waveform according to the dragging operation Drag from the first position to the second position;
  • the position to be cropped determination module is configured to determine the second position as the position to be cropped of the audio to be cropped.
  • an embodiment of the present application provides an electronic device including a memory and a processor, the memory is coupled to the processor, the memory stores instructions, and the instructions are executed when the instructions are executed by the processor.
  • the processor executes the above method.
  • an embodiment of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores program code, and the program code can be invoked by a processor to execute the foregoing method.
  • FIG. 1 shows a schematic flowchart of a method for determining an audio clipping position provided by an embodiment of the present application
  • FIG. 2 shows a schematic diagram of a first interface of an electronic device provided by an embodiment of the present application
  • FIG. 3 shows a schematic diagram of a second interface of an electronic device provided by an embodiment of the present application
  • FIG. 4 shows a schematic flowchart of a method for determining an audio cutting position according to another embodiment of the present application
  • FIG. 5 shows a schematic diagram of a third interface of an electronic device provided by an embodiment of the present application.
  • FIG. 6 shows a schematic diagram of a fourth interface of an electronic device provided by an embodiment of the present application.
  • FIG. 7 shows a schematic flowchart of step S213 of the method for determining the audio cropping position shown in FIG. 4 of the present application;
  • FIG. 8 shows a block diagram of modules of an apparatus for determining an audio cutting position provided by an embodiment of the present application
  • FIG. 9 shows a block diagram of an electronic device used to execute the method for determining an audio cutting position according to an embodiment of the present application.
  • FIG. 10 shows a storage unit for storing or carrying program code for implementing the method for determining the audio cropping position according to the embodiment of the present application according to an embodiment of the present application.
  • waveform area operation refers to the view that shows the sound intensity of the audio playback area
  • preview bar refers to the display.
  • the left and right sides of the waveform are preset with cropping bars.
  • the user can set the starting and ending positions of cropping by dragging the cropping bars on the left and right sides of the waveform to achieve audio cropping.
  • the crop bar refers to a tool bar that can be used to set the start and end positions of cropping by dragging.
  • the waveform area operation can specifically include the following steps: 1. The user clicks a fixed position of the waveform to jump to the playback position, that is, the user clicks a certain position of the waveform to set the position of the playback progress bar, and the playback progress The position of the bar is determined as the playback position; 2.
  • the audio is played to obtain and locate the audio content, and the starting point and end position of the crop are preliminarily confirmed; 3.
  • the crop bar is adjusted repeatedly, and the playback confirms whether the starting position of the crop is correct; 4. Confirm the end position of the cut in the same way.
  • the waveform can be amplified and adjusted for accuracy and then cropped and positioned.
  • the waveform can be easily positioned after the waveform is amplified, it is not possible to adjust the global playback position of the audio, for example .
  • After the waveform is zoomed in if you set the start point and then set the end point, you need to zoom out and display the waveform again, which is inconvenient to operate.
  • the audio cropping method of waveform area operation if you need to accurately locate the position of the audio cropping point, you must constantly adjust the start and end positions of the crop, and move the playback progress bar to confirm the playback, or judge with the waveform. inconvenient.
  • the left and right sides of the preview bar are preset with crop bars.
  • the user can set the crop position by dragging the crop bars on both sides of the preview bar, and then trim the waveform by adjusting the waveform. Fine adjustment of location.
  • the operation of the preview bar area can specifically include the following steps: 1. The user confirms the time point of the starting point roughly to be cropped through audio playback; 2. Adjusting the time point of the corresponding starting point position by dragging the crop bar on the left side of the preview bar; 2. Confirm the position of the specific time point by playing, and use the crop bar on the left side of the waveform area to fine-tune; 3. Confirm the end position of the crop in the same way.
  • the crop bar in the preview bar has the functions of clicking to change the playback position and dragging the crop at the same time. It is prone to accidental touches in interaction, which may cause the playback progress when the crop bar is moved. It is extremely inconvenient to move to the cutting position.
  • the display range can be adjusted by zooming the waveform area with two fingers, so that the waveform and the moving speed of the cutting bar in the preview bar can be adapted to facilitate the adjustment of the preview bar
  • the inventor has discovered through long-term research and proposed the method, device, electronic device, and storage medium for determining the audio cutting position provided by the embodiments of the present application.
  • the position to be cut is located by the position of the playback progress bar in the waveform.
  • the specific method for determining the audio clipping position will be described in detail in the subsequent embodiments.
  • FIG. 1 shows a schematic flowchart of a method for determining an audio clipping position according to an embodiment of the present application.
  • the method for determining the audio cropping position is used to locate the position to be cropped by the position of the playback progress bar in the waveform, so as to improve the efficiency and accuracy of determining the audio cropping position.
  • the method for determining the audio cutting position is applied to the apparatus 200 for determining the audio cutting position as shown in FIG. 8 and the electronic device 100 configured with the apparatus 200 for determining the audio cutting position (FIG. 9) .
  • the following will take an electronic device as an example to describe the specific process of this embodiment.
  • the electronic device applied in this embodiment may be a smart phone, a tablet computer, a wearable electronic device, etc., which is not limited here.
  • the process shown in FIG. 1 will be described in detail below, and the method for determining the audio clipping position may specifically include the following steps:
  • Step S101 Display an audio cropping interface and play the audio to be cropped.
  • the audio cropping interface includes a waveform corresponding to the audio to be cropped and a playback progress bar associated in the waveform.
  • the electronic device can display an audio cropping interface and play the audio to be cropped.
  • the electronic device can run an audio cropping application in the foreground and display the audio cropping interface corresponding to the audio cropping application.
  • the electronic device can run the audio cropping application in the foreground and display the audio cropping interface corresponding to the audio cropping application when it detects a touch operation on the icon of the audio cropping application.
  • the audio cropping application can be run in the foreground and the audio cropping interface corresponding to the audio cropping application can be displayed;
  • the audio cropping application is run in the foreground and the audio cropping interface corresponding to the audio cropping application is displayed, which is not limited here.
  • the audio trimming interface may at least include a waveform corresponding to the audio to be trimmed and a playback progress bar associated in the waveform, that is, the waveform is displayed on the audio trimming interface, and the playback progress bar is displayed on the waveform.
  • the waveform refers to a view showing the sound intensity of the audio playback area of the audio to be trimmed, and the playback progress bar is used to reflect the current playback position of the audio to be trimmed.
  • the waveform can be displayed in a partial area of the upper half of the audio trimming interface, a partial area that can be displayed in the lower half of the audio trimming interface, a partial area that can be displayed in the middle of the audio trimming interface, etc., here Not limited. Please refer to Figure 2.
  • FIG. 2 shows a schematic diagram of the first interface of an electronic device provided by an embodiment of the present application.
  • A represents a waveform
  • B represents a playback progress bar
  • C represents an audio preview bar.
  • waveform A is displayed on the audio cropping interface (the waveform A shown in Figure 2 is displayed in a partial area of the upper half of the audio cropping interface), and the playback progress bar B is displayed on waveform A and is associated with waveform A.
  • the electronic device can play the audio to be trimmed. It is understandable that the electronic device can play the audio to be trimmed from the position where the playback progress bar is located. Generally, the position where the playback progress bar is located is the beginning of the audio to be trimmed. Start position, the electronic device can start playing from the start time of the audio to be cut, which is not limited here. Among them, the electronic device can automatically play the audio to be cut when entering the audio cutting interface, or can play the audio to be cut when receiving a play instruction in the audio to be cut, which is not limited here.
  • the electronic device can detect the user's touch operation on the audio cropping interface, where the user's touch operation on the audio cropping interface can include single-finger tapping, multi-finger tapping, single-finger pressing, and multi-finger tapping. Press operation, single-finger sliding operation, multi-finger sliding operation, single-finger long-press operation, multi-finger long-press operation, etc.
  • the audio cropping interface may display a playback control control, which is used to control the playback or pause of the audio to be cropped based on a user operation.
  • the user's first target touch operation on the playback control control is detected, It is determined that the user triggers the audio playback instruction, where the first target touch operation may include, but is not limited to, a single-finger click operation on the playback control control.
  • the electronic device can play the audio to be cut in response to the audio play instruction triggered by the user.
  • the electronic device can detect the position of the playback progress bar when confirming that the user triggers the audio playback instruction, wherein, when the position of the playback progress bar is detected, it can start to play the waiting position from the position of the playback progress bar.
  • the position of the playback progress bar may include the position corresponding to any moment between the start time and the end time of the audio to be trimmed, and generally may include the position corresponding to the start time of the audio to be trimmed and the time when the playback was last paused. The corresponding location is not limited here.
  • the interface shown in FIG. 2 may include a playback control control, and the electronic device may start playing the to-be-cut audio when detecting a touch operation on the playback control control, which is not limited here.
  • Step S102 When a crop position setting instruction is received, determine the current position of the playback progress bar in the waveform, use the current position as the first position, and add an audio crop bar at the first position.
  • the electronic device may continue to detect touch operations on the audio cropping interface during the process of displaying the audio cropping interface and playing the audio to be cropped.
  • the audio cropping interface may also display a cropping position setting control.
  • a second target touch operation acting on the cropping position setting control it can be determined that the electronic device has received the cropping position setting instruction, where the second The target touch operation includes, but is not limited to, a single-finger click operation that acts on the crop position setting control.
  • the crop position setting control may include a “set start point” control, a “set end point” control, etc., which are not limited here.
  • the electronic device when the electronic device receives the crop position setting instruction, it can respond to the crop position setting instruction to obtain the current position of the playback progress bar in the waveform, and use the obtained current position as the first position. For example, when the electronic device receives the crop position setting instruction when the audio to be cropped is played to the 5th minute, at this time, the current position of the playback progress bar is the position corresponding to the 5th minute of the audio to be cropped, and the audio to be cropped The position corresponding to the 5th minute is the first position.
  • the electronic device when the electronic device receives the crop position setting instruction when the audio to be cropped is played to the 10th minute, at this time, the current position of the playback progress bar is the position corresponding to the tenth minute of the audio to be cropped.
  • the position corresponding to the 10th minute of the audio is regarded as the first position, which will not be repeated here.
  • the first position can be initially confirmed as the position to be cropped, and an audio cropping bar can be generated and added at the first position, where the audio cropping bar is used to locate the crop to be cropped The position of the audio to be cut.
  • Figure 3 shows a schematic diagram of a second interface of an electronic device provided by an embodiment of the present application.
  • A represents a waveform
  • B represents a playback progress bar
  • C represents an audio preview bar
  • D represents an audio
  • the current position of the playback progress bar in the waveform can be as shown in the audio crop bar D in Figure 3 Position.
  • the playback progress bar C can move from the position of the audio cropping bar D along with the playback progress Go to the position shown in Figure 3.
  • Step S103 When a playback adjustment instruction is received, adjust the playback progress bar in the waveform to a second position pointed by the playback adjustment instruction.
  • the electronic device may continue to detect touch operations acting on the audio cropping interface during the process of displaying the audio cropping interface and continuing to play the audio to be cropped.
  • the audio cropping interface may also display a playback adjustment control.
  • a third target touch operation on the playback adjustment control it may be determined that the electronic device has received a playback adjustment instruction, where the third target touch Operations include, but are not limited to, click operations and sliding operations that act on the playback adjustment controls.
  • the playback adjustment control may include a waveform, that is, when a drag operation acting on the waveform is detected, it can be determined that a playback adjustment instruction is received.
  • the electronic device when the electronic device receives the playback adjustment instruction, it can respond to the playback adjustment instruction to adjust the playback progress bar in the waveform to the position pointed by the playback adjustment instruction, and use the position pointed by the playback adjustment instruction as the first
  • the second position is understandable.
  • the to-be-cut audio starts to be played from the second position.
  • the playback progress bar may be adjusted to the position corresponding to the second minute of the audio to be cut in response to the playback adjustment instruction.
  • the playback adjustment control is a waveform
  • the playback adjustment command is triggered by a drag operation on the waveform
  • it is regarded as when the drag operation on the waveform stops, and the position of the playback progress bar is pointed to by the audio adjustment command. The second position.
  • Step S104 Receive a drag operation acting on the audio crop bar, and drag the audio crop bar from the first position to the second position in the waveform according to the drag operation.
  • the user when the electronic device starts to play the audio to be trimmed from the second position in response to the play adjustment instruction, the user can learn the audio content of the audio to be trimmed, and determine whether to start from the first audio content based on the learned audio content of the audio to be trimmed.
  • the audio to be cropped is cropped at the second position.
  • the audio cropping bar can be dragged from the first position to the second position, and the audio to be cropped can be cropped at the second position. Cropping.
  • the second position can be reset and the audio to be cropped can be cropped at the reset second position.
  • the audio cropping bar when the user determines that the audio to be cropped is clipped from the second position determined in the above steps, the audio cropping bar can be dragged.
  • the electronic device receives the drag operation acting on the audio cropping bar and executes it according to the The drag operation drags the audio cropping bar from the first position to the second position in the waveform to select the position to be cropped.
  • the audio cropping bar can be controlled to move to a position completely coincident with the first position based on a drag operation acting on the audio cropping bar, and the audio cropping bar can also be controlled based on a drag operation acting on the audio cropping bar.
  • Move to a position with a certain error from the first position for example, control the audio cropping bar to the left of the first position or control the audio cropping bar to the right of the first position, etc.
  • the position where the position of the audio cropping bar completely coincides with the first position is controlled.
  • the electronic device responds to the playback adjustment instruction from the 5th minute.
  • the user can determine whether the audio content corresponding to the second position needs to be cut according to the learned audio content.
  • the to-be-cut audio is played for 30 seconds, That is, when the position of the playback progress bar is located at 5 minutes and 30 seconds, if the user determines to trim the audio to be trimmed from the second position, the user can drag the audio trim bar to the position of 5 minutes.
  • Step S105 Determine the second position as the position to be cropped of the audio to be cropped.
  • the second position may be determined as the position to be cropped of the audio to be cropped.
  • An embodiment of the present application provides a method for determining an audio cutting position, displaying an audio cutting interface and playing the audio to be cut.
  • the audio cutting interface includes a waveform corresponding to the audio to be cut and a playback progress bar associated in the waveform.
  • determine the current position of the playback progress bar in the waveform use the current position as the first position and add an audio clipping bar at the first position.
  • adjust the playback progress bar in the waveform to play Adjust the second position pointed to by the instruction, receive the drag operation acting on the audio crop bar, and drag the audio crop bar in the waveform from the first position to the second position according to the drag operation, and determine the second position as the waiting position.
  • the position to be cut is cropped, so as to locate the position to be cut through the position of the playback progress bar in the waveform, so as to improve the efficiency and accuracy of determining the audio cut position.
  • FIG. 4 shows a schematic flowchart of a method for determining an audio clipping position according to another embodiment of the present application.
  • the following will elaborate on the process shown in FIG. 4, and the method for determining the audio clipping position may specifically include the following steps:
  • Step S201 Display the audio cropping interface.
  • step S201 For the specific description of step S201, please refer to step S101, which will not be repeated here.
  • Step S202 In response to the play position selection instruction acting on the audio cropping interface, adjust the play progress bar to the third position pointed to by the play position selection instruction in the waveform.
  • the electronic device can detect the touch operation that acts on the audio cropping interface.
  • the audio cropping interface can display a playback position selection control, and when the fourth target touch that acts on the playback position selection control is detected During the control operation, it can be determined that the user triggers the play position selection instruction, where the fourth target touch operation may include, but is not limited to, a sliding operation, a click operation, etc. acting on the play position selection control.
  • the electronic device can respond to the user-triggered play position selection instruction, adjust the play progress bar in the waveform to the position pointed to by the play position selection instruction, and point the play position selection instruction to As the third position. For example, if the playback position selection instruction indicates the position of the 5th minute of the audio to be cut, the electronic device can adjust the playback progress bar in the waveform to the position corresponding to the 5th minute of the audio to be cut; for another example, if the playback position is selected The instruction indicates the position of the 6th minute of the audio to be cut, and the electronic device can adjust the playback progress bar in the waveform to a position corresponding to the 6th minute of the audio to be cut.
  • the audio cropping interface of the electronic device may further include an audio preview bar, where the audio preview bar is used to display the overall waveform of the audio to be cropped.
  • the waveform and the audio preview bar can be displayed together in different areas of the audio cropping interface.
  • the waveform is displayed in a partial area of the upper half of the audio cropping interface and the audio preview bar is displayed in a partial area of the lower half of the audio cropping interface.
  • the waveform is displayed in a partial area of the lower half of the audio trimming interface
  • the audio preview bar is displayed in a partial area of the upper half of the audio trimming interface.
  • the waveform and audio preview bars are displayed in a partial area of the upper half of the audio trimming interface.
  • Both the waveform and audio preview bar are displayed in a partial area of the lower half of the audio cropping interface.
  • C represents the audio preview bar. It is understandable that the audio preview bar C shown in Figure 2 is set below the waveform A. In other embodiments, the audio preview bar C can also be set Above the waveform A, etc., which are not limited here.
  • the electronic device can detect the touch operation acting on the audio preview bar, and when detecting the fourth target touch operation on the audio preview bar by the user, it can be determined that the user triggers the play position selection instruction ,
  • the fourth target touch operation may include, but is not limited to, a sliding operation, a click operation, etc. acting on the audio preview bar.
  • the electronic device can respond to the touch operation (play position selection instruction) on the audio preview bar to adjust the play progress bar to the third position pointed to by the play position selection instruction in the waveform.
  • Step S203 Start playing the audio to be cropped from the third position.
  • the playback progress bar is adjusted to the third position, and the to-be-cut audio can be played from the third position.
  • Step S204 When a crop position setting instruction is received, determine the current position of the playback progress bar in the waveform, use the current position as the first position, and add an audio crop bar at the first position.
  • Step S205 When the first drag gesture acting on the waveform is received, adjust the playback progress bar in the waveform according to the first drag gesture to the position pointed by the first drag gesture The second position.
  • step S204-step S205 please refer to step S102-step S103, which will not be repeated here.
  • Step S206 Add an identification bar to the second location, where the identification bar is used to identify the second location.
  • the electronic device may respond to the playback adjustment instruction to play the audio to be cut, and add an identification bar at the second position, where the identification The bar is used to identify the second position, so as to realize the automatic recording of the adjusted playback start position (second position), without the user's own memorization, and the precise positioning of the cutting position can be more convenient.
  • an identification bar may be generated and displayed at the second position in the waveform, where the identification bar may include, but is not limited to, an identification bar with a different color from the playback progress bar, an identification bar with a different shape from the playback progress bar, An identification bar with a different length/width from the playback progress bar.
  • FIG. 5 shows a schematic diagram of a third interface of an electronic device provided by an embodiment of the present application.
  • A represents a waveform
  • C represents an audio preview bar
  • E represents an identification bar, where, as shown in Figure 5
  • the waveform A is displayed on the audio cutting interface
  • the marking bar E is displayed on the waveform A to mark the second position.
  • Step S207 In response to the playback pause instruction, the playback of the to-be-cut audio is paused.
  • the user can click the play displayed on the audio cutting interface.
  • the control is controlled to control the electronic device to pause playing the audio to be cut.
  • the electronic device receives a playback pause instruction triggered by the user, for example, when the electronic device detects a click operation for acting on the playback control control, the electronic device can pause the playback of the to-be-cut audio.
  • Step S208 Receive a drag operation acting on the audio crop bar, and drag the audio crop bar in the waveform according to the drag operation to a position coincident with the identification bar.
  • the electronic device may respond to the user-triggered crop position setting instruction and add an audio crop bar to the position where the playback progress bar is located.
  • the audio cropping bar is dragged to a position that completely overlaps the logo bar based on the user's drag operation, the location of the logo bar can be set as the position to be cropped.
  • the audio cropping bar is dragged based on the user's drag operation
  • the position where the audio cropping bar is located can be set as the position to be cropped, where the error is within the allowable error range.
  • the crop positioning function is integrated into the playback progress bar, which maintains the continuity of the user playing audio to determine the location to be cropped and setting the cropping operation at that location, and solves the difficulty in the long audio of the current solution. Locate the defect in the cutting position.
  • Step S209 Determine the second position as the position to be cropped of the audio to be cropped.
  • step S209 For the specific description of step S209, please refer to step S105, which will not be repeated here.
  • Step S210 When a second drag gesture acting on the audio cropping bar is received, adjust the audio cropping bar to the second drag gesture in the waveform in response to the second dragging gesture Point to the fourth position.
  • the audio cropping bar can be dragged to adjust the position.
  • the electronic device can detect the drag gesture (denoted as the second drag gesture) acting on the audio cropping bar, and when detecting the second drag gesture acting on the audio cropping bar, it can respond to the first drag gesture.
  • the second drag gesture adjusts the audio cropping bar in the waveform to the position pointed by the second drag gesture, and the position pointed by the second drag gesture is recorded as the fourth position.
  • Step S211 Determine the fourth position as the position to be cropped of the audio to be cropped.
  • the fourth position pointed to by the second drag gesture can be acquired, and the fourth position is determined as the waiting position of the audio to be cropped. Cropping position.
  • a waveform graph and an audio preview bar are integrated in the audio cropping interface.
  • the audio preview bar provides the full-time waveform display of the current waveform and the cursor display function of the playback position.
  • a custom view can be used to realize the waveform, the playback cursor, and the drawing of the area to be cropped in the onDraw method of the View.
  • the playback cursor position is dynamically updated during the playback process.
  • the waveform graph provides functions such as the cutting start node, the cutting end node, the dynamic adjustment and drawing of the cutting time area, and the waveform details display.
  • ItemView completes the drawing of the waveform details of the node every 6s.
  • the drawing logic of the crop area, crop start position, and crop end position can also be implemented by ItemView.
  • RecyclerView handles the specific logic of user interaction, tracks the touch event of the user’s finger, and transfers the displacement data of the corresponding click event to the ItemView through the interface to trigger the ItemView to redraw, so as to refresh the new cropping area and start on the audio cropping interface. Start position.
  • Waveform graph and audio preview bar need to share waveform data, crop start, crop end and other data. Simultaneous display requires two views to be linked.
  • Step S212 Obtain a plurality of positions to be cut, and the plurality of positions to be cut include a start point to be cut and an end point to be cut.
  • the user can set multiple positions to be cropped on the waveform, and the multiple positions to be cropped may include the starting point to be cropped and the ending position to be cropped. It is understandable that more A position to be cropped may include multiple starting positions to be cropped and multiple ending positions to be cropped, wherein multiple starting positions to be cropped and multiple ending positions to be cropped correspond one-to-one, so as to achieve cropping from a certain audio to be cropped Multiple pieces of audio data.
  • taking multiple positions to be cut including a starting point to be cut and an end position to be cut as an example please refer to FIG. 6, which shows a fourth interface of an electronic device provided by an embodiment of the present application.
  • A represents the waveform
  • C represents the audio preview bar
  • D1 represents the starting point to be cropped
  • D2 represents the end position to be cropped, where the starting point to be cropped D1 can be generated by the "set start point” control, to be cropped
  • the end position D2 can be generated by the "Set End” control.
  • Step S213 In response to the cropping instruction, crop the audio to be cropped between the starting point to be cropped and the ending position to be cropped.
  • the electronic device can detect the touch operation that acts on the audio cropping interface.
  • the audio cropping interface can display an audio cropping control, and when the fifth target touch that acts on the audio cropping control is detected During the control operation, it may be determined that the cropping instruction is received, where the fifth target touch operation may include, but is not limited to, a single-finger click operation acting on the audio cropping control.
  • the electronic device when the electronic device detects the fifth target touch operation acting on the audio cropping control, it can respond to the fifth target touch operation and perform the audio to be cropped between the start position to be cropped and the end position to be cropped. Cropped.
  • the cutting of the audio to be cut between the starting position of the cutting and the ending position of the cutting can rely on the Android.media.MediaExtractor class provided by Android, which can be used to read the audio file from a specified time node.
  • the audio stream data is read into a buffer each time, and then it is dynamically determined whether the time of the currently read file exceeds the specified time (the time between the starting point to be cropped and the end position to be cropped), and the streaming is stopped if the specified time is exceeded If it does not reach the specified time, it will continue to read and copy to the new file in a loop.
  • FIG. 7 shows a schematic flowchart of step S213 of the method for determining the audio cropping position shown in FIG. 4 of the present application.
  • the process shown in FIG. 7 will be described in detail below, and the method may specifically include the following steps:
  • Step S2131 When a deletion instruction is received, in response to the deletion instruction, cut and delete the to-be-cut audio between the to-be-cut starting point and the to-be-cut end position.
  • the audio cropping interface of the electronic device may include an audio deletion control, as shown in FIG. 6.
  • the electronic device can detect the touch operation acting on the audio delete control, and when detecting the sixth target touch operation acting on the audio delete control, it can determine to receive the delete instruction, where the sixth target touch
  • the operation may include, but is not limited to, a single-finger click operation on the audio delete control.
  • the electronic device when the electronic device detects the sixth target touch operation acting on the audio delete control, it can respond to the sixth target touch operation and perform the to-be-cut audio between the start position to be cut and the end position to be cut. Cut and delete.
  • Step S2132 When an extraction instruction is received, in response to the extraction instruction, cut and extract the to-be-cut audio between the starting point to be cut and the end point to be cut.
  • the audio cropping interface of the electronic device may include audio extraction controls, as shown in FIG. 6.
  • the electronic device can detect the touch operation acting on the audio extraction control, and when detecting the seventh target touch operation acting on the audio extraction control, it can determine to receive the extraction instruction, where the seventh target touch
  • the operation may include, but is not limited to, a single-finger click operation on the audio extraction control.
  • the electronic device when the electronic device detects the seventh target touch operation acting on the audio extraction control, it can respond to the seventh target touch operation, and perform the to-be-cut audio between the start position to be cut and the end position to be cut. Crop and extract.
  • the method for determining the audio clipping position provided by another embodiment of the present application displays the audio clipping interface, and in response to the playback position selection instruction acting on the audio clipping interface, the playback progress bar is adjusted to the third point of the playback position selection instruction in the waveform. Position, starting from the third position to play the audio to be cropped.
  • the audio cropping bar is adjusted to the fourth position pointed to by the second dragging gesture in the waveform in response to the second dragging gesture, and the fourth position is determined as waiting
  • the position to be cropped to crop the audio Obtain multiple positions to be cropped, including the start position to be cropped and the end position to be cropped, and respond to the cropping instruction to crop the audio to be cropped between the start position to be cropped and the end position to be cropped. Compared with the method for determining the audio cutting position shown in FIG.
  • the position to be cut can also be adjusted by adjusting the waveform and the cutting bar, and when the position to be cut includes the starting point to be cut and the end position to be cut, the position to be cut can be cut Audio is cropped to improve the efficiency and accuracy of audio cropping.
  • FIG. 8 shows a block diagram of a module 200 of an apparatus 200 for determining an audio cutting position provided by an embodiment of the present application.
  • the device 200 for determining the audio cutting position includes: an interface display module 210, a first position determining module 220, a second position adjusting module 230, a cutting bar dragging module 240, and a waiting The cutting position determining module 250, wherein:
  • the interface display module 210 is configured to display an audio cropping interface and play the audio to be cropped.
  • the audio cropping interface includes a waveform corresponding to the audio to be cropped and a playback progress bar associated with the waveform.
  • the interface display module 210 includes: an interface display sub-module, a third position adjustment sub-module, and an audio playback sub-module, wherein:
  • the interface display sub-module is used to display the audio cutting interface.
  • the third position adjustment sub-module is configured to adjust the playback progress bar to the third position pointed to by the playback position selection instruction in the waveform in response to the playback position selection instruction acting on the audio cropping interface.
  • the audio cropping interface further includes an audio preview bar for displaying the global waveform of the audio to be cropped
  • the third position adjustment submodule includes: a third position adjustment unit, wherein:
  • the third position adjustment unit is configured to adjust the playback progress bar to the third position pointed to by the playback position selection instruction in the waveform in response to the playback position selection instruction acting on the audio preview bar.
  • the audio playing submodule is used to start playing the to-be-cut audio from the third position.
  • the first position determining module 220 is configured to determine the current position of the playback progress bar in the waveform when receiving a crop position setting instruction, and use the current position as the first position and add it to the first position Audio clipping bar.
  • the second position adjustment module 230 is configured to, when a playback adjustment instruction is received, adjust the playback progress bar in the waveform to the second position pointed to by the playback adjustment instruction. Further, the second position adjustment module 230 includes: a second position adjustment sub-module, wherein:
  • the second position adjustment submodule is configured to adjust the playback progress bar to the first drag gesture in the waveform according to the first drag gesture when the first drag gesture acting on the waveform is received The second position pointed by a drag gesture.
  • the crop bar dragging module 240 is configured to receive a drag operation acting on the audio crop bar, and drag the audio crop bar from the first position to the waveform in the waveform according to the drag operation The second position. Further, the crop bar drag operation 240 includes: a crop bar drag sub-module, wherein:
  • the cropping bar drag sub-module is used to receive the drag operation acting on the audio cropping bar, and drag the audio cropping bar in the waveform to coincide with the identification bar according to the drag operation s position.
  • the to-be-cut position determining module 250 is configured to determine the second position as the to-be-cut position of the to-be-cut audio.
  • the device 200 for determining the audio cutting position further includes:
  • the identification strip adding module is configured to add an identification strip to the second position, and the identification strip is used to identify the second position.
  • the device 200 for determining the audio cutting position further includes: a fourth position adjustment module and a to-be-cut position update module, wherein:
  • the fourth position adjustment module is configured to adjust the audio cropping bar to the waveform in the waveform in response to the second dragging gesture when a second drag gesture acting on the audio cropping bar is received The fourth position pointed to by the second drag gesture.
  • the position to be cropped update module is configured to determine the fourth position as the position to be cropped of the audio to be cropped.
  • the device 200 for determining the audio cutting position further includes: a pause playing module, wherein:
  • the pause playback module is used to respond to the playback pause instruction and pause the playback of the to-be-cut audio.
  • the device 200 for determining the audio cutting position further includes: a module for obtaining a position to be cut and a cutting module, wherein:
  • the position obtaining module to be cropped is used to obtain a plurality of positions to be cropped, and the plurality of positions to be cropped include a starting point position to be cropped and an end position to be cropped.
  • the cropping module is configured to respond to a cropping instruction to crop the audio to be cropped between the starting point to be cropped and the end position to be cropped. Further, the cropping module includes: a crop deletion sub-module and a crop extraction sub-module, wherein:
  • the cropping deletion sub-module is configured to, when receiving a deletion instruction, respond to the deletion instruction to crop and delete the audio to be cropped between the start position to be cropped and the end position to be cropped.
  • the cropping extraction sub-module is configured to crop and extract the audio to be cropped between the start position to be cropped and the end position to be cropped in response to the extraction instruction when the extraction instruction is received.
  • the coupling between the modules may be electrical, mechanical or other forms of coupling.
  • each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
  • FIG. 9 shows a structural block diagram of an electronic device 100 provided by an embodiment of the present application.
  • the electronic device 100 may be an electronic device capable of running application programs, such as a smart phone, a tablet computer, or an e-book.
  • the electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, a display screen 130, and one or more application programs, of which one or more application programs may be stored in the memory 120 and be It is configured to be executed by one or more processors 110, and one or more programs are configured to execute the method described in the foregoing method embodiment.
  • the processor 110 may include one or more processing cores.
  • the processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and calling data stored in the memory 120.
  • Various functions and processing data of the electronic device 100 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA).
  • DSP Digital Signal Processing
  • FPGA Field-Programmable Gate Array
  • PLA Programmable Logic Array
  • the processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like.
  • the CPU mainly processes the operating system, user interface, and application programs; the GPU is used for rendering and drawing of display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented by a communication chip alone.
  • the memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory).
  • the memory 120 may be used to store instructions, programs, codes, code sets or instruction sets.
  • the memory 120 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc.
  • the data storage area can also store data (such as phone book, audio and video data, chat record data) created by the terminal 100 during use.
  • the display screen 130 is used to display the information input by the user, the information provided to the user, and various graphical user interfaces of the electronic device 100. These graphical user interfaces can be composed of graphics, text, icons, numbers, videos, and any combination thereof.
  • the display screen 130 may be a liquid crystal display (LCD) or an organic light-emitting diode (OLED), which is not limited here.
  • FIG. 10 shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application.
  • the computer-readable medium 300 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
  • the computer-readable storage medium 300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM.
  • the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium.
  • the computer-readable storage medium 300 has storage space for the program code 310 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products.
  • the program code 310 may be compressed in a suitable form, for example.
  • the method, device, electronic device, and storage medium for determining the audio cutting position display the audio cutting interface and play the audio to be cut.
  • the audio cutting interface includes the waveform corresponding to the audio to be cut and the current waveform
  • determine the current position of the playing progress bar in the waveform use the current position as the first position and add the audio cutting bar at the first position
  • Adjust the playback progress bar in the waveform to the second position pointed to by the playback adjustment instruction receive the drag operation on the audio crop bar, and drag the audio crop bar from the first position in the waveform according to the drag operation
  • the second position is determined as the position to be cropped of the audio to be cropped, so that the position to be cropped is located through the position of the playback progress bar in the waveform, so as to improve the efficiency and accuracy of determining the audio crop position.

Abstract

The present application discloses an audio cutting position determination method and apparatus, an electronic device, and a storage medium. The method comprises: displaying an audio cutting interface, and playing an audio to be cut, wherein the audio cutting interface comprises a waveform corresponding to the audio and an associated playing progress bar in the waveform; when a cutting position configuration instruction is received, determining a current position of the playing progress bar in the waveform, using the current position as a first position, and adding an audio cutting bar to the first position; when a playing adjustment instruction is received, adjusting the playing progress bar in the waveform to a second position pointed out by the playing adjustment instruction; receiving a drag operation acting on the audio cutting bar, and dragging the audio cutting bar in the waveform from the first position to the second position according to the drag operation; and determining the second position as a position to be cut of the audio. In this embodiment, the position to be cut is located according to the position of the playing progress bar in the waveform, thereby improving the efficiency and accuracy of determining an audio cutting position.

Description

音频裁剪位置的确定方法、装置、电子设备以及存储介质Method, device, electronic equipment and storage medium for determining audio cutting position
相关申请的交叉引用Cross-references to related applications
本申请要求于2019年08月29日提交的申请号为CN201910809621.7的中国申请的优先权,其在此出于所有目的通过引用将其全部内容并入本文。This application claims the priority of the Chinese application with the application number CN201910809621.7 filed on August 29, 2019, which is hereby incorporated in its entirety by reference for all purposes.
技术领域Technical field
本申请涉及电子设备技术领域,更具体地,涉及一种音频裁剪位置的确定方法、装置、电子设备以及存储介质。This application relates to the technical field of electronic equipment, and more specifically, to a method, apparatus, electronic equipment, and storage medium for determining an audio cutting position.
背景技术Background technique
随着科学技术的发展,电子设备的使用越来越广泛,功能越来越多,已经成为人们日常生活中的必备之一。With the development of science and technology, electronic devices are used more and more widely, with more and more functions, and they have become one of the must-haves in people's daily life.
发明内容Summary of the invention
鉴于上述问题,本申请提出了一种音频裁剪位置的确定方法、装置、电子设备以及存储介质,以解决上述问题。In view of the above-mentioned problems, this application proposes a method, device, electronic device and storage medium for determining the audio cutting position to solve the above-mentioned problems.
第一方面,本申请实施例提供了一种音频裁剪位置的确定方法,所述方法包括:显示音频裁剪界面并播放待裁剪音频,所述音频裁剪界面包括与所述待裁剪音频对应的波形和在所述波形中关联的播放进度条;当接收到裁剪位置设置指令时,确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条;当接收到播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置;接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条从所述第一位置拖动至所述第二位置;将所述第二位置确定为所述待裁剪音频的待裁剪位置。In a first aspect, an embodiment of the present application provides a method for determining an audio cropping position, the method includes: displaying an audio cropping interface and playing the audio to be cropped, the audio cropping interface including waveforms and waveforms corresponding to the audio to be cropped The associated playback progress bar in the waveform; when a crop position setting instruction is received, the current position of the playback progress bar in the waveform is determined, the current position is taken as the first position, and the current position is in the first position. Add an audio cropping bar to the position; when a playback adjustment instruction is received, adjust the playback progress bar to the second position pointed to by the playback adjustment instruction in the waveform; receive a drag on the audio cropping bar Operation, and drag the audio cropping bar in the waveform from the first position to the second position according to the drag operation; determine the second position as the waiting position of the audio to be cropped Cropping position.
第二方面,本申请实施例提供了一种音频裁剪位置的确定装置,所述装置包括:界面显示模块,用于显示音频裁剪界面并播放待裁剪音频,所述音频裁剪界面包括与所述待裁剪音频对应的波形和在所述波形中关联的播放进度条;第一位置确定模块,用于当接收到裁剪位置设置指令时,确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条;第二位置调整模块,用于当接收到播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置;裁剪条拖动模块,用于接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条从所述第一位置拖动至所述第二位置;待裁剪位置确定模块,用于将所述第二位置确定为所述待裁剪音频的待裁剪位置。In a second aspect, an embodiment of the present application provides a device for determining an audio cutting position. The device includes: an interface display module for displaying an audio cutting interface and playing the audio to be cut, the audio cutting interface includes The waveform corresponding to the clipped audio and the associated playback progress bar in the waveform; the first position determining module is used to determine the current position of the playback progress bar in the waveform when the clipping position setting instruction is received, and The current position is used as the first position and an audio cropping bar is added at the first position; the second position adjustment module is configured to adjust the playback progress bar to the desired position in the waveform when a playback adjustment instruction is received. The second position pointed to by the playback adjustment instruction; a cropping bar dragging module for receiving a drag operation acting on the audio cropping bar, and cutting the audio cropping bar in the waveform according to the dragging operation Drag from the first position to the second position; the position to be cropped determination module is configured to determine the second position as the position to be cropped of the audio to be cropped.
第三方面,本申请实施例提供了一种电子设备,包括存储器和处理器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时所述处理器执行上述方法。In a third aspect, an embodiment of the present application provides an electronic device including a memory and a processor, the memory is coupled to the processor, the memory stores instructions, and the instructions are executed when the instructions are executed by the processor. The processor executes the above method.
第四方面,本申请实施例提供了一种计算机可读取存储介质,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行上述方法。In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, and the computer-readable storage medium stores program code, and the program code can be invoked by a processor to execute the foregoing method.
附图说明Description of the drawings
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly describe the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings that need to be used in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
图1示出了本申请一个实施例提供的音频裁剪位置的确定方法的流程示意图;FIG. 1 shows a schematic flowchart of a method for determining an audio clipping position provided by an embodiment of the present application;
图2示出了本申请实施例提供的电子设备的第一种界面示意图;FIG. 2 shows a schematic diagram of a first interface of an electronic device provided by an embodiment of the present application;
图3示出了本申请实施例提供的电子设备的第二种界面示意图;FIG. 3 shows a schematic diagram of a second interface of an electronic device provided by an embodiment of the present application;
图4示出了本申请又一个实施例提供的音频裁剪位置的确定方法的流程示意图;FIG. 4 shows a schematic flowchart of a method for determining an audio cutting position according to another embodiment of the present application;
图5示出了本申请实施例提供的电子设备的第三种界面示意图;FIG. 5 shows a schematic diagram of a third interface of an electronic device provided by an embodiment of the present application;
图6示出了本申请实施例提供的电子设备的第四种界面示意图;FIG. 6 shows a schematic diagram of a fourth interface of an electronic device provided by an embodiment of the present application;
图7示出了本申请的图4所示的音频裁剪位置的确定方法的步骤S213的流程示意图;FIG. 7 shows a schematic flowchart of step S213 of the method for determining the audio cropping position shown in FIG. 4 of the present application;
图8示出了本申请实施例提供的音频裁剪位置的确定装置的模块框图;FIG. 8 shows a block diagram of modules of an apparatus for determining an audio cutting position provided by an embodiment of the present application;
图9示出了本申请实施例用于执行根据本申请实施例的音频裁剪位置的确定方法的电子设备的框图;FIG. 9 shows a block diagram of an electronic device used to execute the method for determining an audio cutting position according to an embodiment of the present application;
图10示出了本申请实施例的用于保存或者携带实现根据本申请实施例的音频裁剪位置的确定方法的程序代码的存储单元。FIG. 10 shows a storage unit for storing or carrying program code for implementing the method for determining the audio cropping position according to the embodiment of the present application according to an embodiment of the present application.
具体实施方式detailed description
为了使本技术领域的人员更好地理解本申请方案,下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。In order to enable those skilled in the art to better understand the solutions of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application.
随着电子设备技术的发展,其所应用的领域也越来越多,例如,电子设备被越来越多的应用于音频裁剪领域。发明人经过研究发现,通过电子设备对音频进行裁剪的方案主要可分为波形区域操作和预览条区域操作两种,其中,波形是指展示音频播放区域的声音强度的视图,预览条是指展示音频全程及裁剪位置点的概览图。With the development of electronic device technology, more and more fields are applied. For example, electronic devices are more and more used in the field of audio cutting. The inventor found through research that the solution of cutting audio through electronic equipment can be divided into two types: waveform area operation and preview bar area operation. Among them, the waveform refers to the view that shows the sound intensity of the audio playback area, and the preview bar refers to the display. An overview map of the entire audio process and cutting locations.
其中,以波形区域操作为例,波形的左右两侧预先设置有裁剪条,用户可以通过拖动波形左右两侧的裁剪条设定裁剪的起点位置和终点位置,以实现音频的裁剪,其中,裁剪条是指通过拖动来设定裁剪的起点位置和终点位置的工具条。波形区域操作具体可以包括以下步骤:1、用户通过点击波形的某个固定位置进行播放位置的跳转,即用户通过点击波形的某个位置,以设定播放进度条的位置,并将播放进度条所在的位置确定为播放位置;2、播放音频进行音频内容的获取和定位,初步确认裁剪的起点位置和终点位置;3、反复调整裁剪条,并且播放确认裁剪的起点位置是否正确;4、通过相同的方式确认裁剪的终点位置。Among them, taking the operation of the waveform area as an example, the left and right sides of the waveform are preset with cropping bars. The user can set the starting and ending positions of cropping by dragging the cropping bars on the left and right sides of the waveform to achieve audio cropping. The crop bar refers to a tool bar that can be used to set the start and end positions of cropping by dragging. The waveform area operation can specifically include the following steps: 1. The user clicks a fixed position of the waveform to jump to the playback position, that is, the user clicks a certain position of the waveform to set the position of the playback progress bar, and the playback progress The position of the bar is determined as the playback position; 2. The audio is played to obtain and locate the audio content, and the starting point and end position of the crop are preliminarily confirmed; 3. The crop bar is adjusted repeatedly, and the playback confirms whether the starting position of the crop is correct; 4. Confirm the end position of the cut in the same way.
但是,基于上述波形区域操作的音频裁剪方式,在音频文件较长时,通过拖动波形上的左右裁剪条进行音频位置的确定会变得难以操作,例如,当音频文件的总时长在半个小时及以上时,裁剪条轻轻移动一下,则音频播放位置会有很大的改动,从而造成拖动裁剪条难以进行定位。而为了解决音频文件较长造成裁剪定位困难的问题,可以将波形放大进行准确度调节后进行裁剪定位,但是,波形放大后虽然可以方便进行定位,但是无法进行音频全局的播放位置的调节,例如,波形放大后,若设定起点位置后再设定终点位置,则需要重新将波形缩小显示,操作不便。另外,基于上述波形区域操作的音频裁剪方式,若需准确定位音频裁剪点的位置则必须通过不断调节裁剪的起点位置和终点位置,并且移动播放进度条进行播放确认,或者配合波形进行判断,十分不方便。However, based on the above-mentioned audio cropping method of waveform area operation, when the audio file is long, it becomes difficult to determine the audio position by dragging the left and right cropping bars on the waveform. For example, when the total duration of the audio file is half the length of the audio file. At hours and above, if the crop bar is moved slightly, the audio playback position will be greatly changed, which makes it difficult to drag the crop bar to locate. In order to solve the problem of difficult cutting and positioning caused by long audio files, the waveform can be amplified and adjusted for accuracy and then cropped and positioned. However, although the waveform can be easily positioned after the waveform is amplified, it is not possible to adjust the global playback position of the audio, for example , After the waveform is zoomed in, if you set the start point and then set the end point, you need to zoom out and display the waveform again, which is inconvenient to operate. In addition, based on the above-mentioned audio cropping method of waveform area operation, if you need to accurately locate the position of the audio cropping point, you must constantly adjust the start and end positions of the crop, and move the playback progress bar to confirm the playback, or judge with the waveform. inconvenient.
其中,以预览条区域操作为例,预览条的左右两侧预先设置有裁剪条,用户可以通过拖动预览条的两侧的裁剪条进行裁剪位置的初步设定,再通过调节波形图进行裁剪位置的细调。预览条区域操作具体可以包括以下步骤:1、用户通过音频播放确认大致需要裁剪的起点位置的时间点;2、通过拖动预览条上左侧的裁剪条调整至相应的起点位置的时间点;2、通过播放确认具体时间点的位置,使用波形区域的左侧的裁剪条进行微调;3、通过相同的方式确认裁剪的终点位置。Among them, take the operation of the preview bar area as an example. The left and right sides of the preview bar are preset with crop bars. The user can set the crop position by dragging the crop bars on both sides of the preview bar, and then trim the waveform by adjusting the waveform. Fine adjustment of location. The operation of the preview bar area can specifically include the following steps: 1. The user confirms the time point of the starting point roughly to be cropped through audio playback; 2. Adjusting the time point of the corresponding starting point position by dragging the crop bar on the left side of the preview bar; 2. Confirm the position of the specific time point by playing, and use the crop bar on the left side of the waveform area to fine-tune; 3. Confirm the end position of the crop in the same way.
但是,基于上述预览条区域操作的音频裁剪方式,该预览条中的裁剪条同时具备点击改变播放位置和拖动裁剪的功能,交互上容易发生误触,导致移动裁剪条时可能造成播放进度会移动至裁剪位置,操作极为不方便。同时,在音频文件较长时,通过拖动预览条上的裁剪条会导致波形区域的大幅度变化,难以在波形中准确定位裁剪位置(例如,若波形默认显示5秒的音频信息,而音频文件的长度为10分钟时,在移动预览条时会导 致波形以120倍的移动速度移动,难以将裁剪位置准确定位至波形的目标位置处)。而为了解决音频文件较长时造成裁剪定位困难的问题,可以通过双指缩放波形区域进行显示范围的调节,使波形和预览条中的裁剪条的移动速度相适应,以方便通过调节预览条中的裁剪条对波形进行准确定位,然而这种方式操作隐性且需要用户自行调节来找到适合的显示范围,使用门槛高。However, based on the audio cropping method of the preview bar area operation, the crop bar in the preview bar has the functions of clicking to change the playback position and dragging the crop at the same time. It is prone to accidental touches in interaction, which may cause the playback progress when the crop bar is moved. It is extremely inconvenient to move to the cutting position. At the same time, when the audio file is long, dragging the crop bar on the preview bar will cause a large change in the waveform area, and it is difficult to accurately locate the crop position in the waveform (for example, if the waveform displays 5 seconds of audio information by default, and the audio When the file length is 10 minutes, moving the preview bar will cause the waveform to move at 120 times the moving speed, and it is difficult to accurately locate the cropping position to the target position of the waveform). In order to solve the problem of difficult cutting and positioning when the audio file is long, the display range can be adjusted by zooming the waveform area with two fingers, so that the waveform and the moving speed of the cutting bar in the preview bar can be adapted to facilitate the adjustment of the preview bar The cropping bar of the for accurate positioning of the waveform, but this way of operation is hidden and requires the user to adjust to find a suitable display range, and the threshold for use is high.
针对上述问题,发明人经过长期的研究发现,并提出了本申请实施例提供的音频裁剪位置的确定方法、装置、电子设备以及存储介质,通过播放进度条的在波形中的位置定位待裁剪位置,以提升音频裁剪位置确定的效率和准确性。其中,具体的音频裁剪位置的确定方法在后续的实施例中进行详细的说明。In response to the above problems, the inventor has discovered through long-term research and proposed the method, device, electronic device, and storage medium for determining the audio cutting position provided by the embodiments of the present application. The position to be cut is located by the position of the playback progress bar in the waveform. , In order to improve the efficiency and accuracy of determining the audio cutting position. Among them, the specific method for determining the audio clipping position will be described in detail in the subsequent embodiments.
请参阅图1,图1示出了本申请一个实施例提供的音频裁剪位置的确定方法的流程示意图。所述音频裁剪位置的确定方法用于通过播放进度条的在波形中的位置定位待裁剪位置,以提升音频裁剪位置确定的效率和准确性。在具体的实施例中,所述音频裁剪位置的确定方法应用于如图8所示的音频裁剪位置的确定装置200以及配置有所述音频裁剪位置的确定装置200的电子设备100(图9)。下面将以电子设备为例,说明本实施例的具体流程,当然,可以理解的,本实施例所应用的电子设备可以为智能手机、平板电脑、穿戴式电子设备等,在此不做限定。下面将针对图1所示的流程进行详细的阐述,所述音频裁剪位置的确定方法具体可以包括以下步骤:Please refer to FIG. 1, which shows a schematic flowchart of a method for determining an audio clipping position according to an embodiment of the present application. The method for determining the audio cropping position is used to locate the position to be cropped by the position of the playback progress bar in the waveform, so as to improve the efficiency and accuracy of determining the audio cropping position. In a specific embodiment, the method for determining the audio cutting position is applied to the apparatus 200 for determining the audio cutting position as shown in FIG. 8 and the electronic device 100 configured with the apparatus 200 for determining the audio cutting position (FIG. 9) . The following will take an electronic device as an example to describe the specific process of this embodiment. Of course, it is understandable that the electronic device applied in this embodiment may be a smart phone, a tablet computer, a wearable electronic device, etc., which is not limited here. The process shown in FIG. 1 will be described in detail below, and the method for determining the audio clipping position may specifically include the following steps:
步骤S101:显示音频裁剪界面并播放待裁剪音频,所述音频裁剪界面包括与所述待裁剪音频对应的波形和在所述波形中关联的播放进度条。Step S101: Display an audio cropping interface and play the audio to be cropped. The audio cropping interface includes a waveform corresponding to the audio to be cropped and a playback progress bar associated in the waveform.
在一些实施方式中,电子设备可以显示音频裁剪界面并播放待裁剪音频,例如,电子设备可以在前台运行音频裁剪类应用程序,并展示该音频裁剪类应用程序对应的音频裁剪界面。在本实施例中,电子设备可以在检测到作用于音频裁剪类应用程序的图标上的触控操作时,在前台运行该音频裁剪类应用程序并展示该音频裁剪类应用程序对应的音频裁剪界面;可以在检测到作用于与该音频裁剪类应用程序对应的链接上的触控操作时,在前台运行该音频裁剪类应用程序并展示该音频裁剪类应用程序对应的音频裁剪界面;也可以在接收到用户输入的指示启动该音频裁剪类应用程序的语音信息时,在前台运行该音频裁剪类应用程序并展示该音频裁剪类应用程序对应的音频裁剪界面等,在此不做限定。In some embodiments, the electronic device can display an audio cropping interface and play the audio to be cropped. For example, the electronic device can run an audio cropping application in the foreground and display the audio cropping interface corresponding to the audio cropping application. In this embodiment, the electronic device can run the audio cropping application in the foreground and display the audio cropping interface corresponding to the audio cropping application when it detects a touch operation on the icon of the audio cropping application. ; When the touch operation acting on the link corresponding to the audio cropping application is detected, the audio cropping application can be run in the foreground and the audio cropping interface corresponding to the audio cropping application can be displayed; When receiving the voice information input by the user instructing to start the audio cropping application, the audio cropping application is run in the foreground and the audio cropping interface corresponding to the audio cropping application is displayed, which is not limited here.
在本实施例中,该音频裁剪界面至少可以包括与待裁剪音频对应的波形和在波形中关联的播放进度条,也就是说,波形显示于音频裁剪界面上,播放进度条显示于波形上,其中,波形是指展示待裁剪音频的音频播放区域声音强度的视图,播放进度条用于反应待裁剪音频的当前播放位置。作为一种方式,该波形可以显示于音频裁剪界面的上半部的部分区域、可以显示于音频裁剪界面的下半部的部分区域、可以显示于音频裁剪界面的中部的部分区域等,在此不做限定。请参阅图2,图2示出了本申请实施例提供的电子设备的第一种界面示意图,在图2中,A表示波形,B表示播放进度条,C表示音频预览条,其中,如图2所示,波形A显示于音频裁剪界面(图2所示波形A显示于音频裁剪界面的上半部的部分区域),播放进度条B显示于波形A上与波形A关联。In this embodiment, the audio trimming interface may at least include a waveform corresponding to the audio to be trimmed and a playback progress bar associated in the waveform, that is, the waveform is displayed on the audio trimming interface, and the playback progress bar is displayed on the waveform. Among them, the waveform refers to a view showing the sound intensity of the audio playback area of the audio to be trimmed, and the playback progress bar is used to reflect the current playback position of the audio to be trimmed. As a way, the waveform can be displayed in a partial area of the upper half of the audio trimming interface, a partial area that can be displayed in the lower half of the audio trimming interface, a partial area that can be displayed in the middle of the audio trimming interface, etc., here Not limited. Please refer to Figure 2. Figure 2 shows a schematic diagram of the first interface of an electronic device provided by an embodiment of the present application. In Figure 2, A represents a waveform, B represents a playback progress bar, and C represents an audio preview bar. As shown in 2, waveform A is displayed on the audio cropping interface (the waveform A shown in Figure 2 is displayed in a partial area of the upper half of the audio cropping interface), and the playback progress bar B is displayed on waveform A and is associated with waveform A.
在一些实施方式中,电子设备可以播放待裁剪音频,可以理解的是,电子设备可以从播放进度条所在的位置开始播放待裁剪音频,一般地,播放进度条所在的位置为待裁剪音频的起始位置,则电子设备可以从待裁剪音频的起始时刻开始播放,在此不做限定。其中,电子设备可以在进入音频裁剪界面时自动播放待裁剪音频,也可以在待裁剪音频中接收到播放指令时播放待裁剪音频,在此不做限定。In some embodiments, the electronic device can play the audio to be trimmed. It is understandable that the electronic device can play the audio to be trimmed from the position where the playback progress bar is located. Generally, the position where the playback progress bar is located is the beginning of the audio to be trimmed. Start position, the electronic device can start playing from the start time of the audio to be cut, which is not limited here. Among them, the electronic device can automatically play the audio to be cut when entering the audio cutting interface, or can play the audio to be cut when receiving a play instruction in the audio to be cut, which is not limited here.
以电子设备接收到播放指令时播放裁剪音频为例。电子设备可以对用户作用于音频裁剪界面上的触控操作进行检测,其中,用户作用于音频裁剪界面上的触控操作可以包括单指点击操作、多指点击操作、单指按压操作、多指按压操作、单指滑动操作、多指滑动操作、单指长按操作、多指长按操作等。例如,音频裁剪界面可以显示有播放控制控件,该播放控 制控件用于基于用户操作控制待裁剪音频播放或暂停,当检测到用户作用于该播放控制控件上的第一目标触控操作时,可以确定用户触发音频播放指令,其中,第一目标触控操作可以包括但不限于作用于播放控制控件上的单指点击操作。Take the example of playing the cut audio when the electronic device receives the playing instruction. The electronic device can detect the user's touch operation on the audio cropping interface, where the user's touch operation on the audio cropping interface can include single-finger tapping, multi-finger tapping, single-finger pressing, and multi-finger tapping. Press operation, single-finger sliding operation, multi-finger sliding operation, single-finger long-press operation, multi-finger long-press operation, etc. For example, the audio cropping interface may display a playback control control, which is used to control the playback or pause of the audio to be cropped based on a user operation. When the user's first target touch operation on the playback control control is detected, It is determined that the user triggers the audio playback instruction, where the first target touch operation may include, but is not limited to, a single-finger click operation on the playback control control.
作为一种方式,当确认用户触发音频播放指令时,电子设备可以响应用户触发的音频播放指令播放待裁剪音频。在一些实施方式中,电子设备在确认用户触发音频播放指令时,可以检测播放进度条所在的位置,其中,当检测到播放进度条所在的位置时,可以从播放进度条所在的位置开始播放待裁剪音频。在本实施例中,播放进度条所在的位置可以包括待裁剪音频的开始时刻和结束时刻之间的任意时刻对应的位置,一般可以包括待裁剪音频的开始时刻对应的位置和最近一次暂停播放时对应的位置,在此不做限定。例如,若待裁剪音频的总时长为10分钟,而播放进度条所在的位置为待裁剪音频在播放时长为5分钟时对应的位置,那么,可以确定从5分钟开始播放待裁剪音频。例如,如图2所示的界面可以包括播放控制控件,则电子设备可以在检测到作用于播放控制控件上的触控操作时,开始播放待裁剪音频,在此不做限定。As a way, when it is confirmed that the user triggers the audio play instruction, the electronic device can play the audio to be cut in response to the audio play instruction triggered by the user. In some embodiments, the electronic device can detect the position of the playback progress bar when confirming that the user triggers the audio playback instruction, wherein, when the position of the playback progress bar is detected, it can start to play the waiting position from the position of the playback progress bar. Crop audio. In this embodiment, the position of the playback progress bar may include the position corresponding to any moment between the start time and the end time of the audio to be trimmed, and generally may include the position corresponding to the start time of the audio to be trimmed and the time when the playback was last paused. The corresponding location is not limited here. For example, if the total duration of the audio to be trimmed is 10 minutes, and the position of the playback progress bar is the position corresponding to the audio to be trimmed when the playback duration is 5 minutes, then it can be determined to start playing the audio to be trimmed from 5 minutes. For example, the interface shown in FIG. 2 may include a playback control control, and the electronic device may start playing the to-be-cut audio when detecting a touch operation on the playback control control, which is not limited here.
步骤S102:当接收到裁剪位置设置指令时,确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条。Step S102: When a crop position setting instruction is received, determine the current position of the playback progress bar in the waveform, use the current position as the first position, and add an audio crop bar at the first position.
在一些实施方式中,电子设备在显示音频裁剪界面并播放待裁剪音频的过程中,可以继续检测作用于音频裁剪界面的触控操作。例如,音频裁剪界面还可以显示有裁剪位置设置控件,当检测到作用于该裁剪位置设置控件上的第二目标触控操作时,可以确定电子设备接收到裁剪位置设置指令,其中,该第二目标触控操作包括但不限于作用于裁剪位置设置控件上的单指点击操作。如图2所示的界面图,该裁剪位置设置控件可以包括“设置起点”控件、“设置终点”控件等,在此不做限定。In some embodiments, the electronic device may continue to detect touch operations on the audio cropping interface during the process of displaying the audio cropping interface and playing the audio to be cropped. For example, the audio cropping interface may also display a cropping position setting control. When a second target touch operation acting on the cropping position setting control is detected, it can be determined that the electronic device has received the cropping position setting instruction, where the second The target touch operation includes, but is not limited to, a single-finger click operation that acts on the crop position setting control. As shown in the interface diagram of Fig. 2, the crop position setting control may include a “set start point” control, a “set end point” control, etc., which are not limited here.
在本实施例中,当电子设备接收到裁剪位置设置指令时,可以响应该裁剪位置设置指令获取播放进度条在波形中的当前位置,将获取的当前位置作为第一位置。例如,当电子设备在待裁剪音频播放到第5分钟时接收到裁剪位置设置指令时,此时,播放进度条的当前位置为待裁剪音频的第5分钟对应的位置,则可以将待裁剪音频的第5分钟对应的位置作为第一位置。又例如,当电子设备在待裁剪音频播放到第10分钟时接收到裁剪位置设置指令时,此时,播放进度条的当前位置为待裁剪音频的第10分钟对应的位置,则可以将待裁剪音频的第10分钟对应的位置作为第一位置,在此不再赘述。In this embodiment, when the electronic device receives the crop position setting instruction, it can respond to the crop position setting instruction to obtain the current position of the playback progress bar in the waveform, and use the obtained current position as the first position. For example, when the electronic device receives the crop position setting instruction when the audio to be cropped is played to the 5th minute, at this time, the current position of the playback progress bar is the position corresponding to the 5th minute of the audio to be cropped, and the audio to be cropped The position corresponding to the 5th minute is the first position. For another example, when the electronic device receives the crop position setting instruction when the audio to be cropped is played to the 10th minute, at this time, the current position of the playback progress bar is the position corresponding to the tenth minute of the audio to be cropped. The position corresponding to the 10th minute of the audio is regarded as the first position, which will not be repeated here.
作为一种实施方式,当确认接收到裁剪位置设置指令时,可以初步确认将第一位置作为待裁剪位置,可以在第一位置生成并添加音频裁剪条,其中,音频裁剪条用于定位待裁剪音频的待裁剪位置。如图3所示,图3示出了本申请实施例提供的电子设备的第二种界面示意图,在图3中,A表示波形,B表示播放进度条,C表示音频预览条,D表示音频裁剪条,作为一种方式,当电子设备在播放待裁剪音频的过程中,接收到裁剪位置设置指令时,播放进度条在波形中的当前位置可以为图3中的音频裁剪条D所示的位置,此时,可以将该当前位置作为第一位置并添加音频裁剪条D,可以理解的是,待裁剪音频继续播放,播放进度条C可以随着播放进度从音频裁剪条D所在的位置移动到如图3所示的位置。As an implementation manner, when it is confirmed that the crop position setting instruction is received, the first position can be initially confirmed as the position to be cropped, and an audio cropping bar can be generated and added at the first position, where the audio cropping bar is used to locate the crop to be cropped The position of the audio to be cut. As shown in Figure 3, Figure 3 shows a schematic diagram of a second interface of an electronic device provided by an embodiment of the present application. In Figure 3, A represents a waveform, B represents a playback progress bar, C represents an audio preview bar, and D represents an audio The crop bar, as a way, when the electronic device receives the crop position setting instruction during the process of playing the audio to be cropped, the current position of the playback progress bar in the waveform can be as shown in the audio crop bar D in Figure 3 Position. At this time, you can use the current position as the first position and add an audio cropping bar D. It is understandable that the audio to be cropped continues to play, and the playback progress bar C can move from the position of the audio cropping bar D along with the playback progress Go to the position shown in Figure 3.
步骤S103:当接收到播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置。Step S103: When a playback adjustment instruction is received, adjust the playback progress bar in the waveform to a second position pointed by the playback adjustment instruction.
在一些实施方式中,电子设备在显示音频裁剪界面并继续播放待裁剪音频的过程中,可以继续检测作用于音频裁剪界面的触控操作。例如,音频裁剪界面还可以显示有播放调整控件,当检测到作用于该播放调整控件上的第三目标触控操作时,可以确定电子设备接收到播放调整指令,其中,该第三目标触控操作包括但不限于作用于播放调整控件上的点击操作和滑动操作。其中,该播放调整控件可以包括波形,即当检测到作用于波形上的拖动操作时,可以确定接收到播放调整指令。In some embodiments, the electronic device may continue to detect touch operations acting on the audio cropping interface during the process of displaying the audio cropping interface and continuing to play the audio to be cropped. For example, the audio cropping interface may also display a playback adjustment control. When a third target touch operation on the playback adjustment control is detected, it may be determined that the electronic device has received a playback adjustment instruction, where the third target touch Operations include, but are not limited to, click operations and sliding operations that act on the playback adjustment controls. Wherein, the playback adjustment control may include a waveform, that is, when a drag operation acting on the waveform is detected, it can be determined that a playback adjustment instruction is received.
在本实施例中,电子设备在接收到播放调整指令时,可以响应该播放调整指令在波形中将播放进度条调整至该播放调整指令所指向的位置,将播放调整指令所指向的位置 作为第二位置,可以理解的,此时待裁剪音频从第二位置开始播放。例如,当播放调整指令所指向的第二位置为待裁剪音频的第2分钟对应的位置时,可以响应该播放调整指令将播放进度条调整至待裁剪音频的第2分钟对应的位置。又例如,若播放调整控件为波形,播放调整指令由作用于波形上的拖动操作触发,则当作用于波形上的拖动操作停止时,播放进度条所在的位置则为音频调整指令指向的第二位置。In this embodiment, when the electronic device receives the playback adjustment instruction, it can respond to the playback adjustment instruction to adjust the playback progress bar in the waveform to the position pointed by the playback adjustment instruction, and use the position pointed by the playback adjustment instruction as the first The second position is understandable. At this time, the to-be-cut audio starts to be played from the second position. For example, when the second position pointed to by the playback adjustment instruction is the position corresponding to the second minute of the audio to be cut, the playback progress bar may be adjusted to the position corresponding to the second minute of the audio to be cut in response to the playback adjustment instruction. For another example, if the playback adjustment control is a waveform, and the playback adjustment command is triggered by a drag operation on the waveform, it is regarded as when the drag operation on the waveform stops, and the position of the playback progress bar is pointed to by the audio adjustment command. The second position.
步骤S104:接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条从所述第一位置拖动至所述第二位置。Step S104: Receive a drag operation acting on the audio crop bar, and drag the audio crop bar from the first position to the second position in the waveform according to the drag operation.
在一些实施方式中,电子设备在响应播放调整指令从第二位置开始播放待裁剪音频的过程中,用户可以获知待裁剪音频的音频内容,并基于获知的待裁剪音频的音频内容确定是否从第二位置对待裁剪音频进行裁剪,其中,当用户确定从第二位置对待裁剪音频进行裁剪时,则可以将音频裁剪条从第一位置拖动到第二位置,并在第二位置对待裁剪音频进行裁剪,当用户确定不从第二位置对待裁剪音频进行裁剪时,则可以重新设定第二位置并在重新设定的第二位置对待裁剪音频进行裁剪。In some embodiments, when the electronic device starts to play the audio to be trimmed from the second position in response to the play adjustment instruction, the user can learn the audio content of the audio to be trimmed, and determine whether to start from the first audio content based on the learned audio content of the audio to be trimmed. The audio to be cropped is cropped at the second position. When the user determines to crop the audio to be cropped from the second position, the audio cropping bar can be dragged from the first position to the second position, and the audio to be cropped can be cropped at the second position. Cropping. When the user determines not to crop the audio to be cropped from the second position, the second position can be reset and the audio to be cropped can be cropped at the reset second position.
在本实施例中,当用户确定从上述步骤确定的第二位置对待裁剪音频进行裁剪时可以拖动音频裁剪条,相应的,电子设备接收作用于音频裁剪条上的拖动操作,并根据该拖动操作在波形中将音频裁剪条从第一位置拖动到第二位置,以进行待裁剪位置的选定。在一些实施方式中,基于作用于音频裁剪条上的拖动操作可以控制音频裁剪条移动至与第一位置完全重合的位置、基于作用于音频裁剪条上的拖动操作也可以控制音频裁剪条移动至与第一位置存在一定误差的位置处,例如,控制音频裁剪条位于第一位置的左边或控制音频裁剪条位于第一位置的右边等。可选地,在本实施例中,控制音频裁剪条位置与第一位置完全重合的位置。In this embodiment, when the user determines that the audio to be cropped is clipped from the second position determined in the above steps, the audio cropping bar can be dragged. Correspondingly, the electronic device receives the drag operation acting on the audio cropping bar and executes it according to the The drag operation drags the audio cropping bar from the first position to the second position in the waveform to select the position to be cropped. In some embodiments, the audio cropping bar can be controlled to move to a position completely coincident with the first position based on a drag operation acting on the audio cropping bar, and the audio cropping bar can also be controlled based on a drag operation acting on the audio cropping bar. Move to a position with a certain error from the first position, for example, control the audio cropping bar to the left of the first position or control the audio cropping bar to the right of the first position, etc. Optionally, in this embodiment, the position where the position of the audio cropping bar completely coincides with the first position is controlled.
例如,若待裁剪音频的总时长为10分钟,基于播放调整指令所确定的第二位置为待裁剪音频在播放时长为5分钟时对应的位置,则电子设备响应播放调整指令从第5分钟开始播放该待裁剪音频,在待裁剪音频播放的过程中,用户可以针对获知的音频内容确定从第二位置对开始应的音频内容是否是所需进行裁剪的,当待裁剪音频播放30秒时,即播放进度条所在的位置位于5分30秒的位置时,若用户确定从第二位置对待裁剪音频进行裁剪,那么,用户可以拖动音频裁剪条至5分钟的位置。For example, if the total duration of the audio to be trimmed is 10 minutes, and the second position determined based on the playback adjustment instruction is the position corresponding to the playback duration of the audio to be trimmed at 5 minutes, the electronic device responds to the playback adjustment instruction from the 5th minute. Play the to-be-cut audio. During the playback of the to-be-cut audio, the user can determine whether the audio content corresponding to the second position needs to be cut according to the learned audio content. When the to-be-cut audio is played for 30 seconds, That is, when the position of the playback progress bar is located at 5 minutes and 30 seconds, if the user determines to trim the audio to be trimmed from the second position, the user can drag the audio trim bar to the position of 5 minutes.
步骤S105:将所述第二位置确定为所述待裁剪音频的待裁剪位置。Step S105: Determine the second position as the position to be cropped of the audio to be cropped.
在一些实施方式中,在将音频裁剪条拖动至第二位置后,可以将第二位置确定为待裁剪音频的待裁剪位置。In some embodiments, after dragging the audio cropping bar to the second position, the second position may be determined as the position to be cropped of the audio to be cropped.
本申请一个实施例提供的音频裁剪位置的确定方法,显示音频裁剪界面并播放待裁剪音频,音频裁剪界面包括与待裁剪音频对应的波形和在波形中关联的播放进度条,当接收到裁剪位置设置指令时,确定播放进度条在波形中的当前位置,将当前位置作为第一位置并在第一位置添加音频裁剪条,当接收到播放调整指令时,在波形中将播放进度条调整至播放调整指令指向的第二位置,接收作用于音频裁剪条上的拖动操作,并根据拖动操作在波形中将音频裁剪条从第一位置拖动至第二位置,将第二位置确定为待裁剪音频的待裁剪位置,从而通过播放进度条的在波形中的位置定位待裁剪位置,以提升音频裁剪位置确定的效率和准确性。An embodiment of the present application provides a method for determining an audio cutting position, displaying an audio cutting interface and playing the audio to be cut. The audio cutting interface includes a waveform corresponding to the audio to be cut and a playback progress bar associated in the waveform. When the cutting position is received When setting the command, determine the current position of the playback progress bar in the waveform, use the current position as the first position and add an audio clipping bar at the first position. When the playback adjustment command is received, adjust the playback progress bar in the waveform to play Adjust the second position pointed to by the instruction, receive the drag operation acting on the audio crop bar, and drag the audio crop bar in the waveform from the first position to the second position according to the drag operation, and determine the second position as the waiting position. The position to be cut is cropped, so as to locate the position to be cut through the position of the playback progress bar in the waveform, so as to improve the efficiency and accuracy of determining the audio cut position.
请参阅图4,图4示出了本申请又一个实施例提供的音频裁剪位置的确定方法的流程示意图。下面将针对图4所示的流程进行详细的阐述,所述音频裁剪位置的确定方法具体可以包括以下步骤:Please refer to FIG. 4, which shows a schematic flowchart of a method for determining an audio clipping position according to another embodiment of the present application. The following will elaborate on the process shown in FIG. 4, and the method for determining the audio clipping position may specifically include the following steps:
步骤S201:显示音频裁剪界面。Step S201: Display the audio cropping interface.
其中,步骤S201的具体描述请参阅步骤S101,在此不再赘述。For the specific description of step S201, please refer to step S101, which will not be repeated here.
步骤S202:响应作用于所述音频裁剪界面上的播放位置选择指令,在所述波形中将所述播放进度条调整至所述播放位置选择指令指向的第三位置。Step S202: In response to the play position selection instruction acting on the audio cropping interface, adjust the play progress bar to the third position pointed to by the play position selection instruction in the waveform.
在一些实施方式中,电子设备可以对作用于音频裁剪界面的触控操作进行检测,例如,音频裁剪界面可以显示有播放位置选择控件,当检测到作用于播放位置选择控件上的第四目 标触控操作时,可以确定用户触发播放位置选择指令,其中,第四目标触控操作可以包括但不限于作用于播放位置选择控件上的滑动操作、点击操作等。In some embodiments, the electronic device can detect the touch operation that acts on the audio cropping interface. For example, the audio cropping interface can display a playback position selection control, and when the fourth target touch that acts on the playback position selection control is detected During the control operation, it can be determined that the user triggers the play position selection instruction, where the fourth target touch operation may include, but is not limited to, a sliding operation, a click operation, etc. acting on the play position selection control.
作为一种方式,当确认用户触发播放位置选择指令时,电子设备可以响应用户触发的播放位置选择指令,在波形中将播放进度条调整至播放位置选择指令指向的位置,将播放位置选择指令指向的位置作为第三位置。例如,若播放位置选择指令指示待裁剪音频的第5分钟的位置,则电子设备可以在波形中将播放进度条调整至与待裁剪音频的第5分钟对应的位置;又例如,若播放位置选择指令指示待裁剪音频的第6分钟的位置,则电子设备可以在波形中将播放进度条调整至与待裁剪音频的第6分钟对应的位置。As a way, when it is confirmed that the user triggers the play position selection instruction, the electronic device can respond to the user-triggered play position selection instruction, adjust the play progress bar in the waveform to the position pointed to by the play position selection instruction, and point the play position selection instruction to As the third position. For example, if the playback position selection instruction indicates the position of the 5th minute of the audio to be cut, the electronic device can adjust the playback progress bar in the waveform to the position corresponding to the 5th minute of the audio to be cut; for another example, if the playback position is selected The instruction indicates the position of the 6th minute of the audio to be cut, and the electronic device can adjust the playback progress bar in the waveform to a position corresponding to the 6th minute of the audio to be cut.
在一些实施方式中,电子设备的音频裁剪界面还可以包括音频预览条,其中,该音频预览条用于展示待裁剪音频的波形全局。其中,波形和音频预览条可以在音频裁剪界面的不同区域共同进行显示,例如,波形在音频裁剪界面的上半部的部分区域显示且音频预览条在音频裁剪界面的下半部的部分区域显示、波形在音频裁剪界面的下半部的部分区域显示且音频预览条在音频裁剪界面的上半部的部分区域显示、波形和音频预览条均在音频裁剪界面的上半部的部分区域显示、波形和音频预览条均在音频裁剪界面的下半部的部分区域显示等。请再参阅图2,在图2中,C表示音频预览条,可以理解的,图2所示的音频预览条C设置于波形A的下方,在其他实施例中,音频预览条C还可以设置于波形A的上方等,在此不做限定。In some embodiments, the audio cropping interface of the electronic device may further include an audio preview bar, where the audio preview bar is used to display the overall waveform of the audio to be cropped. Among them, the waveform and the audio preview bar can be displayed together in different areas of the audio cropping interface. For example, the waveform is displayed in a partial area of the upper half of the audio cropping interface and the audio preview bar is displayed in a partial area of the lower half of the audio cropping interface. , The waveform is displayed in a partial area of the lower half of the audio trimming interface, and the audio preview bar is displayed in a partial area of the upper half of the audio trimming interface. The waveform and audio preview bars are displayed in a partial area of the upper half of the audio trimming interface. Both the waveform and audio preview bar are displayed in a partial area of the lower half of the audio cropping interface. Please refer to Figure 2 again. In Figure 2, C represents the audio preview bar. It is understandable that the audio preview bar C shown in Figure 2 is set below the waveform A. In other embodiments, the audio preview bar C can also be set Above the waveform A, etc., which are not limited here.
在本实施例中,电子设备可以对作用于音频预览条上的触控操作进行检测,当检测到用户作用于音频预览条上的第四目标触控操作时,可以确定用户触发播放位置选择指令,其中,第四目标触控操作可以包括但不限于作用于音频预览条上的滑动操作、点击操作等。相应的,电子设备可以响应作用于音频预览条上的触控操作(播放位置选择指令),在波形中将播放进度条调整至与播放位置选择指令所指向的第三位置。In this embodiment, the electronic device can detect the touch operation acting on the audio preview bar, and when detecting the fourth target touch operation on the audio preview bar by the user, it can be determined that the user triggers the play position selection instruction , Wherein, the fourth target touch operation may include, but is not limited to, a sliding operation, a click operation, etc. acting on the audio preview bar. Correspondingly, the electronic device can respond to the touch operation (play position selection instruction) on the audio preview bar to adjust the play progress bar to the third position pointed to by the play position selection instruction in the waveform.
步骤S203:从所述第三位置开始播放所述待裁剪音频。Step S203: Start playing the audio to be cropped from the third position.
在一些实施方式中,此时播放进度条被调整至第三位置,则可以从第三位置开始播放待裁剪音频。In some implementations, at this time, the playback progress bar is adjusted to the third position, and the to-be-cut audio can be played from the third position.
步骤S204:当接收到裁剪位置设置指令时,确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条。Step S204: When a crop position setting instruction is received, determine the current position of the playback progress bar in the waveform, use the current position as the first position, and add an audio crop bar at the first position.
步骤S205:当接收到作用于所述波形上的第一拖动手势时,根据所述第一拖动手势在所述波形中将所述播放进度条调整至所述第一拖动手势指向的第二位置。Step S205: When the first drag gesture acting on the waveform is received, adjust the playback progress bar in the waveform according to the first drag gesture to the position pointed by the first drag gesture The second position.
其中,步骤S204-步骤S205的具体描述请参阅步骤S102-步骤S103,在此不再赘述。For the specific description of step S204-step S205, please refer to step S102-step S103, which will not be repeated here.
步骤S206:在所述第二位置添加标识条,所述标识条用于标识所述第二位置。Step S206: Add an identification bar to the second location, where the identification bar is used to identify the second location.
在一些实施方式中,在将播放进度条调整至播放调整指令所指向的第二位置后,电子设备可以响应播放调整指令播放待裁剪音频,并在该第二位置添加标识条,其中,该标识条用于标识该第二位置,从而实现调整后的播放起始位置(第二位置)的自动记录,不需要用户自行记忆,可以更方便的进行裁剪位置的精确定位。在一些实施方式中,可以在波形中的第二位置生成并显示标识条,其中,该标识条可以包括但不限于与播放进度条颜色不同的标识条、与播放进度条形状不同的标识条、与播放进度条长度/宽度不同的标识条。可以理解的是,基于所述标识条,用户可以从音频裁剪界面中直观获知第二位置。请参阅图5,图5示出了本申请实施例提供的电子设备的第三种界面示意图,在图5中,A表示波形,C标识音频预览条,E表示标识条,其中,如图5所示,波形A显示于音频裁剪界面,标识条E显示于波形A上标识第二位置。In some embodiments, after adjusting the playback progress bar to the second position pointed to by the playback adjustment instruction, the electronic device may respond to the playback adjustment instruction to play the audio to be cut, and add an identification bar at the second position, where the identification The bar is used to identify the second position, so as to realize the automatic recording of the adjusted playback start position (second position), without the user's own memorization, and the precise positioning of the cutting position can be more convenient. In some embodiments, an identification bar may be generated and displayed at the second position in the waveform, where the identification bar may include, but is not limited to, an identification bar with a different color from the playback progress bar, an identification bar with a different shape from the playback progress bar, An identification bar with a different length/width from the playback progress bar. It is understandable that, based on the identification bar, the user can intuitively learn the second position from the audio cropping interface. Please refer to FIG. 5, which shows a schematic diagram of a third interface of an electronic device provided by an embodiment of the present application. In FIG. 5, A represents a waveform, C represents an audio preview bar, and E represents an identification bar, where, as shown in Figure 5 As shown, the waveform A is displayed on the audio cutting interface, and the marking bar E is displayed on the waveform A to mark the second position.
步骤S207:响应播放暂停指令,暂停播放所述待裁剪音频。Step S207: In response to the playback pause instruction, the playback of the to-be-cut audio is paused.
在一些实施方式中,在待裁剪音频播放的过程中,若用户基于获知的待裁剪音频的音频内容确定可以从标识条所在的位置对待裁剪音频进行裁剪时,可以点击显示于音频裁剪界面的播放控制控件以控制电子设备暂停播放该待裁剪音频。相应的,电子设备在接收到用户触发的播放暂停指令,例如,电子设备在检测到用于作用于播放控制控件上的点击操作时,可 以暂停播放该待裁剪音频。In some embodiments, during the playback of the to-be-cut audio, if the user determines based on the knowledge of the audio content of the to-be-cut audio that the to-be-cut audio can be cut from the position of the identification bar, the user can click the play displayed on the audio cutting interface. The control is controlled to control the electronic device to pause playing the audio to be cut. Correspondingly, when the electronic device receives a playback pause instruction triggered by the user, for example, when the electronic device detects a click operation for acting on the playback control control, the electronic device can pause the playback of the to-be-cut audio.
步骤S208:接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条拖动至与所述标识条重合的位置。Step S208: Receive a drag operation acting on the audio crop bar, and drag the audio crop bar in the waveform according to the drag operation to a position coincident with the identification bar.
作为一种方式,当确认用户触发裁剪位置设置指令时,电子设备可以响应用户触发的裁剪位置设置指令,将播放进度条所在的位置添加音频裁剪条。其中,当基于用户的拖动操作将音频裁剪条拖动至与标识条完全重合的位置时,可以将标识条所在的位置设置为待裁剪位置,当基于用户的拖动操作将音频裁剪条拖动至与标识条所在的位置存在一定误差的位置处时,可以将音频裁剪条所在的位置设置为待裁剪位置,其中,该误差在允许的误差范围内。因此,在本实施例中,将裁剪定位功能整合入播放进度条,保持了用户播放音频确定待裁剪位置和在该位置设定裁剪操作的连贯性,并且解决了目前方案的长音频中难以便捷地定位裁剪位置的缺陷。As a way, when it is confirmed that the user triggers the crop position setting instruction, the electronic device may respond to the user-triggered crop position setting instruction and add an audio crop bar to the position where the playback progress bar is located. Among them, when the audio cropping bar is dragged to a position that completely overlaps the logo bar based on the user's drag operation, the location of the logo bar can be set as the position to be cropped. When the audio cropping bar is dragged based on the user's drag operation When moving to a position with a certain error from the position of the identification bar, the position where the audio cropping bar is located can be set as the position to be cropped, where the error is within the allowable error range. Therefore, in this embodiment, the crop positioning function is integrated into the playback progress bar, which maintains the continuity of the user playing audio to determine the location to be cropped and setting the cropping operation at that location, and solves the difficulty in the long audio of the current solution. Locate the defect in the cutting position.
步骤S209:将所述第二位置确定为所述待裁剪音频的待裁剪位置。Step S209: Determine the second position as the position to be cropped of the audio to be cropped.
其中,步骤S209的具体描述请参阅步骤S105,在此不再赘述。For the specific description of step S209, please refer to step S105, which will not be repeated here.
步骤S210:当接收到作用于所述音频裁剪条上的第二拖动手势时,响应所述第二拖动手势在所述波形中将所述音频裁剪条调整至所述第二拖动手势指向的第四位置。Step S210: When a second drag gesture acting on the audio cropping bar is received, adjust the audio cropping bar to the second drag gesture in the waveform in response to the second dragging gesture Point to the fourth position.
在一些实施方式中,电子设备在确定待裁剪位置后,若待裁剪位置仍需求进行调整,则可以拖动音频裁剪条进行位置调整。具体地,电子设备可以对作用于音频裁剪条上的拖动手势(记为第二拖动手势)进行检测,当检测到作用于音频裁剪条上的第二拖动手势时,可以响应该第二拖动手势在波形中将音频裁剪条调整至第二拖动手势所指向的位置,将第二拖动手势所指向的位置记为第四位置。In some embodiments, after the electronic device determines the position to be cropped, if the position to be cropped still needs to be adjusted, the audio cropping bar can be dragged to adjust the position. Specifically, the electronic device can detect the drag gesture (denoted as the second drag gesture) acting on the audio cropping bar, and when detecting the second drag gesture acting on the audio cropping bar, it can respond to the first drag gesture. The second drag gesture adjusts the audio cropping bar in the waveform to the position pointed by the second drag gesture, and the position pointed by the second drag gesture is recorded as the fourth position.
步骤S211:将所述第四位置确定为所述待裁剪音频的待裁剪位置。Step S211: Determine the fourth position as the position to be cropped of the audio to be cropped.
进一步地,在检测到作用于音频裁剪条上的第二拖动手势停止或结束时,可以获取该第二拖动手势所指向的第四位置,将该第四位置确定为待裁剪音频的待裁剪位置。Further, when it is detected that the second drag gesture that acts on the audio cropping bar stops or ends, the fourth position pointed to by the second drag gesture can be acquired, and the fourth position is determined as the waiting position of the audio to be cropped. Cropping position.
在本实施例中,在音频裁剪界面集成了波形图和音频预览条。音频预览条提供当前波形的全时域波形显示和播放位置游标显示功能。为实现该功能,可以采用自定义view实现,在View的onDraw方法中完成波形、播放游标、待裁剪区域的绘制,同时在播放过程中,动态更新播放游标位置。In this embodiment, a waveform graph and an audio preview bar are integrated in the audio cropping interface. The audio preview bar provides the full-time waveform display of the current waveform and the cursor display function of the playback position. In order to realize this function, a custom view can be used to realize the waveform, the playback cursor, and the drawing of the area to be cropped in the onDraw method of the View. At the same time, the playback cursor position is dynamically updated during the playback process.
波形图提供波形的裁剪开始节点、裁剪结束节点、裁剪时间区域动态调整和绘制,波形详情显示等功能。为实现该功能,可以采用自定义RecyclerView+自定义ItemView的方式实现。ItemView完成每隔6s时间节点的波形详情绘制,同时裁剪区域、裁剪起点位置、裁剪终点位置的绘制逻辑也可以由ItemView来实现。RecyclerView中处理用户交互的具体逻辑,跟踪用户手指的Touch事件,并将相应的点击事件的位移数据通过接口传入到ItemView中触发ItemView重新绘制,以在音频裁剪界面上刷新新的裁剪区域和起始位置。The waveform graph provides functions such as the cutting start node, the cutting end node, the dynamic adjustment and drawing of the cutting time area, and the waveform details display. In order to achieve this function, you can use custom RecyclerView + custom ItemView to achieve. ItemView completes the drawing of the waveform details of the node every 6s. At the same time, the drawing logic of the crop area, crop start position, and crop end position can also be implemented by ItemView. RecyclerView handles the specific logic of user interaction, tracks the touch event of the user’s finger, and transfers the displacement data of the corresponding click event to the ItemView through the interface to trigger the ItemView to redraw, so as to refresh the new cropping area and start on the audio cropping interface. Start position.
波形图和音频预览条之间需要共享波形数据、裁剪起始、裁剪结束等数据,同时显示需要两个视图联动。Waveform graph and audio preview bar need to share waveform data, crop start, crop end and other data. Simultaneous display requires two views to be linked.
步骤S212:获得多个待裁剪位置,所述多个待裁剪位置包括待裁剪起点位置和待裁剪终点位置。Step S212: Obtain a plurality of positions to be cut, and the plurality of positions to be cut include a start point to be cut and an end point to be cut.
在本实施例中,基于上述对待裁剪位置的设置方式,用户可以在波形上设置多个待裁剪位置,且多个待裁剪位置可以包括待裁剪起点位置和待裁剪终点位置,可以理解的,多个待裁剪位置可以包括多个待裁剪起点位置和多个待裁剪终点位置,其中,多个待裁剪起点位置和多个待裁剪终点位置一一对应,从而可以实现从某一待裁剪音频中裁剪多段音频数据。在一些实施方式中,以多个待裁剪位置包括一个待裁剪起点位置和一个待裁剪终点位置为例,请参阅图6,图6示出了本申请实施例提供的电子设备的第四种界面示意图,在图6中,A表示波形、C表示音频预览条,D1表示待裁剪起点位置,D2表示待裁剪终点位置,其中,该待裁剪起点位置D1可以通过“设置起点”控件生成,待裁剪终点位置D2可以通过“设置 终点”控件生成。In this embodiment, based on the above method of setting the position to be cropped, the user can set multiple positions to be cropped on the waveform, and the multiple positions to be cropped may include the starting point to be cropped and the ending position to be cropped. It is understandable that more A position to be cropped may include multiple starting positions to be cropped and multiple ending positions to be cropped, wherein multiple starting positions to be cropped and multiple ending positions to be cropped correspond one-to-one, so as to achieve cropping from a certain audio to be cropped Multiple pieces of audio data. In some embodiments, taking multiple positions to be cut including a starting point to be cut and an end position to be cut as an example, please refer to FIG. 6, which shows a fourth interface of an electronic device provided by an embodiment of the present application. Schematic diagram, in Figure 6, A represents the waveform, C represents the audio preview bar, D1 represents the starting point to be cropped, D2 represents the end position to be cropped, where the starting point to be cropped D1 can be generated by the "set start point" control, to be cropped The end position D2 can be generated by the "Set End" control.
步骤S213:响应裁剪指令,将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪。Step S213: In response to the cropping instruction, crop the audio to be cropped between the starting point to be cropped and the ending position to be cropped.
在一些实施方式中,电子设备可以对作用于音频裁剪界面上的触控操作进行检测,例如,音频裁剪界面可以显示有音频裁剪控件,当检测到作用于该音频裁剪控件上的第五目标触控操作时,可以确定接收到裁剪指令,其中,第五目标触控操作可以包括但不限于作用于音频裁剪控件上的单指点击操作。相应的,电子设备在检测到作用于音频裁剪控件上的第五目标触控操作时,可以响应该第五目标触控操作,将待裁剪起点位置和待裁剪终点位置之间的待裁剪音频进行裁剪。In some embodiments, the electronic device can detect the touch operation that acts on the audio cropping interface. For example, the audio cropping interface can display an audio cropping control, and when the fifth target touch that acts on the audio cropping control is detected During the control operation, it may be determined that the cropping instruction is received, where the fifth target touch operation may include, but is not limited to, a single-finger click operation acting on the audio cropping control. Correspondingly, when the electronic device detects the fifth target touch operation acting on the audio cropping control, it can respond to the fifth target touch operation and perform the audio to be cropped between the start position to be cropped and the end position to be cropped. Cropped.
其中,对待裁剪起点位置和待裁剪终点位置之间的待裁剪音频的裁剪可以依赖于Android原生提供的Android.media.MediaExtractor类,运用该类可以从一个指定时间节点上的读取音频文件中的音频流数据,每次读取到一个缓冲区中,之后动态判定当前读取的文件时间是否超过指定时长(待裁剪起点位置和待裁剪终点位置之间的时长),超过指定时长,则停止流的读取和复制流程,如果没有到达制定时长,则继续循环读取和复制到新文件。文件截取完成之后可以通过截取开始时间节点和截取完成时间节点,动态计算得到需要的波形数据实际对应节点,节点确定之后即可完成波形数据的截取和保存。Among them, the cutting of the audio to be cut between the starting position of the cutting and the ending position of the cutting can rely on the Android.media.MediaExtractor class provided by Android, which can be used to read the audio file from a specified time node. The audio stream data is read into a buffer each time, and then it is dynamically determined whether the time of the currently read file exceeds the specified time (the time between the starting point to be cropped and the end position to be cropped), and the streaming is stopped if the specified time is exceeded If it does not reach the specified time, it will continue to read and copy to the new file in a loop. After the file interception is completed, you can dynamically calculate the actual corresponding node of the required waveform data through the interception start time node and the interception completion time node, and the waveform data can be intercepted and saved after the node is determined.
请参阅图7,图7示出了本申请的图4所示的音频裁剪位置的确定方法的步骤S213的流程示意图。下面将针对图7所示的流程进行详细的阐述,所述方法具体可以包括以下步骤:Please refer to FIG. 7. FIG. 7 shows a schematic flowchart of step S213 of the method for determining the audio cropping position shown in FIG. 4 of the present application. The process shown in FIG. 7 will be described in detail below, and the method may specifically include the following steps:
步骤S2131:当接收到删除指令时,响应所述删除指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并删除。Step S2131: When a deletion instruction is received, in response to the deletion instruction, cut and delete the to-be-cut audio between the to-be-cut starting point and the to-be-cut end position.
在一些实施方式中,电子设备的音频裁剪界面可以包括音频删除控件,如图6所示。电子设备可以对作用于音频删除控件上的触控操作进行检测,当检测到作用于该音频删除控件上的第六目标触控操作时,可以确定接收到删除指令,其中,第六目标触控操作可以包括但不限于作用于音频删除控件上的单指点击操作。相应的,电子设备在检测到作用于音频删除控件上的第六目标触控操作时,可以响应该第六目标触控操作,将待裁剪起点位置和待裁剪终点位置之间的待裁剪音频进行裁剪并删除。In some embodiments, the audio cropping interface of the electronic device may include an audio deletion control, as shown in FIG. 6. The electronic device can detect the touch operation acting on the audio delete control, and when detecting the sixth target touch operation acting on the audio delete control, it can determine to receive the delete instruction, where the sixth target touch The operation may include, but is not limited to, a single-finger click operation on the audio delete control. Correspondingly, when the electronic device detects the sixth target touch operation acting on the audio delete control, it can respond to the sixth target touch operation and perform the to-be-cut audio between the start position to be cut and the end position to be cut. Cut and delete.
步骤S2132:当接收到提取指令时,响应所述提取指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并提取。Step S2132: When an extraction instruction is received, in response to the extraction instruction, cut and extract the to-be-cut audio between the starting point to be cut and the end point to be cut.
在一些实施方式中,电子设备的音频裁剪界面可以包括音频提取控件,如图6所示。电子设备可以对作用于音频提取控件上的触控操作进行检测,当检测到作用于该音频提取控件上的第七目标触控操作时,可以确定接收到提取指令,其中,第七目标触控操作可以包括但不限于作用于音频提取控件上的单指点击操作。相应的,电子设备在检测到作用于音频提取控件上的第七目标触控操作时,可以响应该第七目标触控操作,将待裁剪起点位置和待裁剪终点位置之间的待裁剪音频进行裁剪并提取。In some embodiments, the audio cropping interface of the electronic device may include audio extraction controls, as shown in FIG. 6. The electronic device can detect the touch operation acting on the audio extraction control, and when detecting the seventh target touch operation acting on the audio extraction control, it can determine to receive the extraction instruction, where the seventh target touch The operation may include, but is not limited to, a single-finger click operation on the audio extraction control. Correspondingly, when the electronic device detects the seventh target touch operation acting on the audio extraction control, it can respond to the seventh target touch operation, and perform the to-be-cut audio between the start position to be cut and the end position to be cut. Crop and extract.
本申请又一个实施例提供的音频裁剪位置的确定方法,显示音频裁剪界面,响应作用于音频裁剪界面上的播放位置选择指令,在波形中将播放进度条调整至播放位置选择指令指向的第三位置,从第三位置开始播放待裁剪音频。当接收到裁剪位置设置指令时,确定播放进度条在波形中的当前位置,将当前位置作为第一位置并在第一位置添加音频裁剪条,当接收到作用于波形上的第一拖动手势时,根据第一拖动手势在所述波形中将播放进度条调整至第一拖动手势指向的第二位置,在第二位置添加标识条,标识条用于标识所述第二位置,响应播放暂停指令,暂停播放待裁剪音频。接收作用于音频裁剪条上的拖动操作,并根据拖动操作在波形中将音频裁剪条拖动至与标识条重合的位置,将第二位置确定为待裁剪音频的待裁剪位置。当接收到作用于音频裁剪条上的第二拖动手势时,响应第二拖动手势在波形中将音频裁剪条调整至第二拖动手势指向的第四位置,将第四位置确定为待裁剪音频的待裁剪位置。获得多个待裁剪位置,多个待裁剪位置包 括待裁剪起点位置和待裁剪终点位置,响应裁剪指令,将待裁剪起点位置和待裁剪终点位置之间的待裁剪音频进行裁剪。相较于图1所示的音频裁剪位置的确定方法,在本实施例还可以通过调整波形和裁剪条调整待裁剪位置,并在待裁剪位置包括待裁剪起点位置和待裁剪终点位置时对待裁剪音频进行裁剪,以提升音频裁剪的效率和准确性。The method for determining the audio clipping position provided by another embodiment of the present application displays the audio clipping interface, and in response to the playback position selection instruction acting on the audio clipping interface, the playback progress bar is adjusted to the third point of the playback position selection instruction in the waveform. Position, starting from the third position to play the audio to be cropped. When receiving the crop position setting instruction, determine the current position of the playback progress bar in the waveform, use the current position as the first position and add the audio crop bar to the first position, when the first drag gesture acting on the waveform is received , Adjust the playback progress bar to the second position pointed to by the first drag gesture in the waveform according to the first drag gesture, add an identification bar to the second position, the identification bar is used to identify the second position, and respond Play the pause command to pause the audio to be cut. Receive the drag operation acting on the audio cropping bar, and drag the audio cropping bar in the waveform to a position coincident with the identification bar according to the dragging operation, and determine the second position as the position to be cropped for the audio to be cropped. When the second drag gesture acting on the audio cropping bar is received, the audio cropping bar is adjusted to the fourth position pointed to by the second dragging gesture in the waveform in response to the second dragging gesture, and the fourth position is determined as waiting The position to be cropped to crop the audio. Obtain multiple positions to be cropped, including the start position to be cropped and the end position to be cropped, and respond to the cropping instruction to crop the audio to be cropped between the start position to be cropped and the end position to be cropped. Compared with the method for determining the audio cutting position shown in FIG. 1, in this embodiment, the position to be cut can also be adjusted by adjusting the waveform and the cutting bar, and when the position to be cut includes the starting point to be cut and the end position to be cut, the position to be cut can be cut Audio is cropped to improve the efficiency and accuracy of audio cropping.
请参阅图8,图8示出了本申请实施例提供的音频裁剪位置的确定装置200的模块框图。下面将针对图8所示的框图进行阐述,所述音频裁剪位置的确定装置200包括:界面显示模块210、第一位置确定模块220、第二位置调整模块230、裁剪条拖动模块240以及待裁剪位置确定模块250,其中:Please refer to FIG. 8, which shows a block diagram of a module 200 of an apparatus 200 for determining an audio cutting position provided by an embodiment of the present application. The following will elaborate on the block diagram shown in FIG. 8. The device 200 for determining the audio cutting position includes: an interface display module 210, a first position determining module 220, a second position adjusting module 230, a cutting bar dragging module 240, and a waiting The cutting position determining module 250, wherein:
界面显示模块210,用于显示音频裁剪界面并播放待裁剪音频,所述音频裁剪界面包括与所述待裁剪音频对应的波形和在所述波形中关联的播放进度条。进一步地,所述界面显示模块210包括:界面显示子模块、第三位置调整子模块以及音频播放子模块,其中:The interface display module 210 is configured to display an audio cropping interface and play the audio to be cropped. The audio cropping interface includes a waveform corresponding to the audio to be cropped and a playback progress bar associated with the waveform. Further, the interface display module 210 includes: an interface display sub-module, a third position adjustment sub-module, and an audio playback sub-module, wherein:
界面显示子模块,用于显示音频裁剪界面。The interface display sub-module is used to display the audio cutting interface.
第三位置调整子模块,用于响应作用于所述音频裁剪界面上的播放位置选择指令,在所述波形中将所述播放进度条调整至所述播放位置选择指令指向的第三位置。进一步地,所述音频裁剪界面还包括音频预览条,所述音频预览条用于展示所述待裁剪音频的波形全局,所述第三位置调整子模块包括:第三位置调整单元,其中:The third position adjustment sub-module is configured to adjust the playback progress bar to the third position pointed to by the playback position selection instruction in the waveform in response to the playback position selection instruction acting on the audio cropping interface. Further, the audio cropping interface further includes an audio preview bar for displaying the global waveform of the audio to be cropped, and the third position adjustment submodule includes: a third position adjustment unit, wherein:
第三位置调整单元,用于响应作用于所述音频预览条上的播放位置选择指令,在所述波形中将所述播放进度条调整至所述播放位置选择指令指向的第三位置。The third position adjustment unit is configured to adjust the playback progress bar to the third position pointed to by the playback position selection instruction in the waveform in response to the playback position selection instruction acting on the audio preview bar.
音频播放子模块,用于从所述第三位置开始播放所述待裁剪音频。The audio playing submodule is used to start playing the to-be-cut audio from the third position.
第一位置确定模块220,用于当接收到裁剪位置设置指令时,确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条。The first position determining module 220 is configured to determine the current position of the playback progress bar in the waveform when receiving a crop position setting instruction, and use the current position as the first position and add it to the first position Audio clipping bar.
第二位置调整模块230,用于当接收到播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置。进一步地,所述第二位置调整模块230包括:第二位置调整子模块,其中:The second position adjustment module 230 is configured to, when a playback adjustment instruction is received, adjust the playback progress bar in the waveform to the second position pointed to by the playback adjustment instruction. Further, the second position adjustment module 230 includes: a second position adjustment sub-module, wherein:
第二位置调整子模块,用于当接收到作用于所述波形上的第一拖动手势时,根据所述第一拖动手势在所述波形中将所述播放进度条调整至所述第一拖动手势指向的第二位置。The second position adjustment submodule is configured to adjust the playback progress bar to the first drag gesture in the waveform according to the first drag gesture when the first drag gesture acting on the waveform is received The second position pointed by a drag gesture.
裁剪条拖动模块240,用于接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条从所述第一位置拖动至所述第二位置。进一步地,所述裁剪条拖动操作240包括:裁剪条拖动子模块,其中:The crop bar dragging module 240 is configured to receive a drag operation acting on the audio crop bar, and drag the audio crop bar from the first position to the waveform in the waveform according to the drag operation The second position. Further, the crop bar drag operation 240 includes: a crop bar drag sub-module, wherein:
裁剪条拖动子模块,用于接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条拖动至与所述标识条重合的位置。The cropping bar drag sub-module is used to receive the drag operation acting on the audio cropping bar, and drag the audio cropping bar in the waveform to coincide with the identification bar according to the drag operation s position.
待裁剪位置确定模块250,用于将所述第二位置确定为所述待裁剪音频的待裁剪位置。The to-be-cut position determining module 250 is configured to determine the second position as the to-be-cut position of the to-be-cut audio.
进一步地,所述音频裁剪位置的确定装置200还包括:Further, the device 200 for determining the audio cutting position further includes:
标识条添加模块,用于在所述第二位置添加标识条,所述标识条用于标识所述第二位置。The identification strip adding module is configured to add an identification strip to the second position, and the identification strip is used to identify the second position.
进一步地,所述音频裁剪位置的确定装置200还包括:第四位置调整模块和待裁剪位置更新模块,其中:Further, the device 200 for determining the audio cutting position further includes: a fourth position adjustment module and a to-be-cut position update module, wherein:
第四位置调整模块,用于当接收到作用于所述音频裁剪条上的第二拖动手势时,响应所述第二拖动手势在所述波形中将所述音频裁剪条调整至所述第二拖动手势指向的第四位置。The fourth position adjustment module is configured to adjust the audio cropping bar to the waveform in the waveform in response to the second dragging gesture when a second drag gesture acting on the audio cropping bar is received The fourth position pointed to by the second drag gesture.
待裁剪位置更新模块,用于将所述第四位置确定为所述待裁剪音频的待裁剪位置。The position to be cropped update module is configured to determine the fourth position as the position to be cropped of the audio to be cropped.
进一步地,所述音频裁剪位置的确定装置200还包括:暂停播放模块,其中:Further, the device 200 for determining the audio cutting position further includes: a pause playing module, wherein:
暂停播放模块,用于响应播放暂停指令,暂停播放所述待裁剪音频。The pause playback module is used to respond to the playback pause instruction and pause the playback of the to-be-cut audio.
进一步地,所述音频裁剪位置的确定装置200还包括:待裁剪位置获得模块和裁剪模块,其中:Further, the device 200 for determining the audio cutting position further includes: a module for obtaining a position to be cut and a cutting module, wherein:
待裁剪位置获得模块,用于获得多个待裁剪位置,所述多个待裁剪位置包括待裁剪起点位置和待裁剪终点位置。The position obtaining module to be cropped is used to obtain a plurality of positions to be cropped, and the plurality of positions to be cropped include a starting point position to be cropped and an end position to be cropped.
裁剪模块,用于响应裁剪指令,将所述待裁剪起点位置和所述待裁剪终点位置之间的待 裁剪音频进行裁剪。进一步地,所述裁剪模块包括:裁剪删除子模块和裁剪提取子模块,其中:The cropping module is configured to respond to a cropping instruction to crop the audio to be cropped between the starting point to be cropped and the end position to be cropped. Further, the cropping module includes: a crop deletion sub-module and a crop extraction sub-module, wherein:
裁剪删除子模块,用于当接收到删除指令时,响应所述删除指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并删除。The cropping deletion sub-module is configured to, when receiving a deletion instruction, respond to the deletion instruction to crop and delete the audio to be cropped between the start position to be cropped and the end position to be cropped.
裁剪提取子模块,用于当接收到提取指令时,响应所述提取指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并提取。The cropping extraction sub-module is configured to crop and extract the audio to be cropped between the start position to be cropped and the end position to be cropped in response to the extraction instruction when the extraction instruction is received.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述装置和模块的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of description, the specific working process of the device and module described above can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,模块相互之间的耦合可以是电性,机械或其它形式的耦合。In the several embodiments provided in this application, the coupling between the modules may be electrical, mechanical or other forms of coupling.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each functional module in each embodiment of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software function modules.
请参阅图9,其示出了本申请实施例提供的一种电子设备100的结构框图。该电子设备100可以是智能手机、平板电脑、电子书等能够运行应用程序的电子设备。本申请中的电子设备100可以包括一个或多个如下部件:处理器110、存储器120、显示屏130以及一个或多个应用程序,其中一个或多个应用程序可以被存储在存储器120中并被配置为由一个或多个处理器110执行,一个或多个程序配置用于执行如前述方法实施例所描述的方法。Please refer to FIG. 9, which shows a structural block diagram of an electronic device 100 provided by an embodiment of the present application. The electronic device 100 may be an electronic device capable of running application programs, such as a smart phone, a tablet computer, or an e-book. The electronic device 100 in this application may include one or more of the following components: a processor 110, a memory 120, a display screen 130, and one or more application programs, of which one or more application programs may be stored in the memory 120 and be It is configured to be executed by one or more processors 110, and one or more programs are configured to execute the method described in the foregoing method embodiment.
其中,处理器110可以包括一个或者多个处理核。处理器110利用各种接口和线路连接整个电子设备100内的各个部分,通过运行或执行存储在存储器120内的指令、程序、代码集或指令集,以及调用存储在存储器120内的数据,执行电子设备100的各种功能和处理数据。可选地,处理器110可以采用数字信号处理(Digital Signal Processing,DSP)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、可编程逻辑阵列(Programmable Logic Array,PLA)中的至少一种硬件形式来实现。处理器110可集成中央处理器(Central Processing Unit,CPU)、图形处理器(Graphics Processing Unit,GPU)和调制解调器等中的一种或几种的组合。其中,CPU主要处理操作***、用户界面和应用程序等;GPU用于负责显示内容的渲染和绘制;调制解调器用于处理无线通信。可以理解的是,上述调制解调器也可以不集成到处理器110中,单独通过一块通信芯片进行实现。The processor 110 may include one or more processing cores. The processor 110 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes by running or executing instructions, programs, code sets, or instruction sets stored in the memory 120, and calling data stored in the memory 120. Various functions and processing data of the electronic device 100. Optionally, the processor 110 may adopt at least one of digital signal processing (Digital Signal Processing, DSP), Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA), and Programmable Logic Array (Programmable Logic Array, PLA). A kind of hardware form to realize. The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), a modem, and the like. Among them, the CPU mainly processes the operating system, user interface, and application programs; the GPU is used for rendering and drawing of display content; the modem is used for processing wireless communication. It can be understood that the above-mentioned modem may not be integrated into the processor 110, but may be implemented by a communication chip alone.
存储器120可以包括随机存储器(Random Access Memory,RAM),也可以包括只读存储器(Read-Only Memory)。存储器120可用于存储指令、程序、代码、代码集或指令集。存储器120可包括存储程序区和存储数据区,其中,存储程序区可存储用于实现操作***的指令、用于实现至少一个功能的指令(比如触控功能、声音播放功能、图像播放功能等)、用于实现下述各个方法实施例的指令等。存储数据区还可以存储终端100在使用中所创建的数据(比如电话本、音视频数据、聊天记录数据)等。The memory 120 may include random access memory (RAM) or read-only memory (Read-Only Memory). The memory 120 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 120 may include a program storage area and a data storage area, where the program storage area may store instructions for implementing the operating system and instructions for implementing at least one function (such as touch function, sound playback function, image playback function, etc.) , Instructions used to implement the following various method embodiments, etc. The data storage area can also store data (such as phone book, audio and video data, chat record data) created by the terminal 100 during use.
显示屏130用于显示由用户输入的信息、提供给用户的信息以及所述电子设备100的各种图形用户接口,这些图形用户接口可以由图形、文本、图标、数字、视频和其任意组合来构成,在一个实例中,该显示屏130可以为液晶显示器(Liquid Crystal Display,LCD),也可以为有机发光二极管(Organic Light-Emitting Diode,OLED),在此不做限定。The display screen 130 is used to display the information input by the user, the information provided to the user, and various graphical user interfaces of the electronic device 100. These graphical user interfaces can be composed of graphics, text, icons, numbers, videos, and any combination thereof. In an example, the display screen 130 may be a liquid crystal display (LCD) or an organic light-emitting diode (OLED), which is not limited here.
请参阅图10,其示出了本申请实施例提供的一种计算机可读存储介质的结构框图。该计算机可读介质300中存储有程序代码,所述程序代码可被处理器调用执行上述方法实施例中所描述的方法。Please refer to FIG. 10, which shows a structural block diagram of a computer-readable storage medium provided by an embodiment of the present application. The computer-readable medium 300 stores program code, and the program code can be invoked by a processor to execute the method described in the foregoing method embodiment.
计算机可读存储介质300可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。可选地,计算机可读存储介质300包括非 易失性计算机可读介质(non-transitory computer-readable storage medium)。计算机可读存储介质300具有执行上述方法中的任何方法步骤的程序代码310的存储空间。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。程序代码310可以例如以适当形式进行压缩。The computer-readable storage medium 300 may be an electronic memory such as flash memory, EEPROM (Electrically Erasable Programmable Read Only Memory), EPROM, hard disk, or ROM. Optionally, the computer-readable storage medium 300 includes a non-transitory computer-readable storage medium. The computer-readable storage medium 300 has storage space for the program code 310 for executing any method steps in the above-mentioned methods. These program codes can be read from or written into one or more computer program products. The program code 310 may be compressed in a suitable form, for example.
综上所述,本申请实施例提供的音频裁剪位置的确定方法、装置、电子设备以及存储介质,显示音频裁剪界面并播放待裁剪音频,音频裁剪界面包括与待裁剪音频对应的波形和在波形中关联的播放进度条,当接收到裁剪位置设置指令时,确定播放进度条在波形中的当前位置,将当前位置作为第一位置并在第一位置添加音频裁剪条,当接收到播放调整指令时,在波形中将播放进度条调整至播放调整指令指向的第二位置,接收作用于音频裁剪条上的拖动操作,并根据拖动操作在波形中将音频裁剪条从第一位置拖动至第二位置,将第二位置确定为待裁剪音频的待裁剪位置,从而通过播放进度条的在波形中的位置定位待裁剪位置,以提升音频裁剪位置确定的效率和准确性。In summary, the method, device, electronic device, and storage medium for determining the audio cutting position provided by the embodiments of the present application display the audio cutting interface and play the audio to be cut. The audio cutting interface includes the waveform corresponding to the audio to be cut and the current waveform When receiving the cutting position setting instruction, determine the current position of the playing progress bar in the waveform, use the current position as the first position and add the audio cutting bar at the first position, when receiving the playback adjustment instruction , Adjust the playback progress bar in the waveform to the second position pointed to by the playback adjustment instruction, receive the drag operation on the audio crop bar, and drag the audio crop bar from the first position in the waveform according to the drag operation To the second position, the second position is determined as the position to be cropped of the audio to be cropped, so that the position to be cropped is located through the position of the playback progress bar in the waveform, so as to improve the efficiency and accuracy of determining the audio crop position.
最后应说明的是:以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不驱使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the application, not to limit them; although the application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The technical solutions recorded in the foregoing embodiments are modified, or some of the technical features are equivalently replaced; these modifications or replacements do not drive the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims (20)

  1. 一种音频裁剪位置的确定方法,其特征在于,所述方法包括:A method for determining an audio cutting position, characterized in that the method includes:
    显示音频裁剪界面并播放待裁剪音频,所述音频裁剪界面包括与所述待裁剪音频对应的波形和在所述波形中关联的播放进度条;Displaying an audio cropping interface and playing the audio to be cropped, where the audio cropping interface includes a waveform corresponding to the audio to be cropped and a playback progress bar associated with the waveform;
    当接收到裁剪位置设置指令时,确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条;When receiving a crop position setting instruction, determine the current position of the playback progress bar in the waveform, use the current position as the first position, and add an audio crop bar at the first position;
    当接收到播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置;When a playback adjustment instruction is received, adjusting the playback progress bar in the waveform to the second position pointed to by the playback adjustment instruction;
    接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条从所述第一位置拖动至所述第二位置;Receiving a drag operation acting on the audio crop bar, and drag the audio crop bar from the first position to the second position in the waveform according to the drag operation;
    将所述第二位置确定为所述待裁剪音频的待裁剪位置。The second position is determined as the position to be cropped of the audio to be cropped.
  2. 根据权利要求1所述的方法,其特征在于,所述当接收到所述播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置之后,还包括:The method according to claim 1, wherein when the playback adjustment instruction is received, after the playback progress bar is adjusted to the second position pointed to by the playback adjustment instruction in the waveform, Also includes:
    在所述第二位置添加标识条,所述标识条用于标识所述第二位置;Adding an identification bar to the second location, where the identification bar is used to identify the second location;
    所述接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条从所述第一位置拖动至所述第二位置,包括:The receiving the drag operation acting on the audio cropping bar, and dragging the audio cropping bar from the first position to the second position in the waveform according to the dragging operation includes :
    接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条拖动至与所述标识条重合的位置。Receiving a drag operation acting on the audio cropping bar, and dragging the audio cropping bar in the waveform to a position coincident with the identification bar according to the dragging operation.
  3. 根据权利要求2所述的方法,其特征在于,所述标识条和所述播放进度条的颜色不同、形状不同、长度不同和/或宽度不同。The method according to claim 2, wherein the identification bar and the playback progress bar have different colors, different shapes, different lengths, and/or different widths.
  4. 根据权利要求1-3任一项所述的方法,其特征在于,所述显示音频裁剪界面并播放待裁剪音频,包括:The method according to any one of claims 1-3, wherein the displaying the audio cropping interface and playing the audio to be cropped comprises:
    显示音频裁剪界面;Display audio cutting interface;
    响应作用于所述音频裁剪界面上的播放位置选择指令,在所述波形中将所述播放进度条调整至所述播放位置选择指令指向的第三位置;In response to the play position selection instruction acting on the audio cropping interface, adjusting the play progress bar to the third position pointed to by the play position selection instruction in the waveform;
    从所述第三位置开始播放所述待裁剪音频。The audio to be cropped is played from the third position.
  5. 根据权利要求4所述的方法,其特征在于,所述音频裁剪界面显示有播放位置选择控件,所述响应作用于所述音频裁剪界面上的播放位置选择指令,在所述波形中将所述播放进度条调整至所述播放位置选择指令指向的第三位置,包括:The method according to claim 4, wherein the audio cropping interface displays a playback position selection control, and in response to the playback position selection instruction acting on the audio cropping interface, the The adjustment of the playback progress bar to the third position pointed to by the playback position selection instruction includes:
    当检测到作用于所述播放位置选择控件上的第四目标触控操作时,确定触发播放位置选择指令;When a fourth target touch operation acting on the play position selection control is detected, determining to trigger a play position selection instruction;
    响应于所述播放位置选择指令,在所述波形中将所述播放进度条调整至所述播放位置选择指令指向的第三位置。In response to the playback position selection instruction, the playback progress bar is adjusted to the third position pointed to by the playback position selection instruction in the waveform.
  6. 根据权利要求4所述的方法,其特征在于,所述音频裁剪界面还包括音频预览条,所述音频预览条用于展示所述待裁剪音频的波形全局,所述响应作用于所述音频裁剪界面上的播放位置选择指令,在所述波形中将所述播放进度条调整至所述播放位置选择指令指向的第三位置,包括:The method according to claim 4, wherein the audio cropping interface further comprises an audio preview bar, the audio preview bar is used to display the global waveform of the audio to be cropped, and the response acts on the audio cropping The playback position selection instruction on the interface, adjusting the playback progress bar to the third position pointed to by the playback position selection instruction in the waveform, includes:
    响应作用于所述音频预览条上的播放位置选择指令,在所述波形中将所述播放进度条调整至所述播放位置选择指令指向的第三位置。In response to the play position selection instruction acting on the audio preview bar, the play progress bar is adjusted to the third position pointed to by the play position selection instruction in the waveform.
  7. 根据权利要求1-6任一项所述的方法,其特征在于,所述当接收到播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置,包括:The method according to any one of claims 1-6, wherein when a playback adjustment instruction is received, the playback progress bar is adjusted in the waveform to a second point pointed by the playback adjustment instruction. Location, including:
    当接收到作用于所述波形上的第一拖动手势时,根据所述第一拖动手势在所述波形中将所述播放进度条调整至所述第一拖动手势指向的第二位置。When receiving the first drag gesture acting on the waveform, adjust the playback progress bar in the waveform to the second position pointed to by the first drag gesture according to the first drag gesture .
  8. 根据权利要求1-6任一项所述的方法,其特征在于,所述将所述第二位置确定为所述待裁剪音频的待裁剪位置之后,还包括:The method according to any one of claims 1-6, wherein after the determining the second position as the position to be cropped of the audio to be cropped, the method further comprises:
    当接收到作用于所述音频裁剪条上的第二拖动手势时,响应所述第二拖动手势在所述波形中将所述音频裁剪条调整至所述第二拖动手势指向的第四位置;When a second drag gesture acting on the audio cropping bar is received, the audio cropping bar is adjusted in the waveform to the second drag gesture pointed to by the second drag gesture in response to the second drag gesture. Four positions
    将所述第四位置确定为所述待裁剪音频的待裁剪位置。The fourth position is determined as the position to be cropped of the audio to be cropped.
  9. 根据权利要求1-8任一项所述的方法,其特征在于,所述接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条从所述第一位置拖动至所述第二位置之前,还包括:The method according to any one of claims 1-8, wherein the receiving a drag operation acting on the audio cropping bar, and the audio is displayed in the waveform according to the drag operation Before dragging the cropping bar from the first position to the second position, it also includes:
    响应播放暂停指令,暂停播放所述待裁剪音频。In response to the playback pause instruction, the playback of the audio to be cut is paused.
  10. 根据权利要求1-9任一项所述的方法,其特征在于,所述将所述第二位置确定为所述待裁剪音频的待裁剪位置之后,还包括:The method according to any one of claims 1-9, wherein after the determining the second position as the position to be cropped of the audio to be cropped, the method further comprises:
    获得多个待裁剪位置,所述多个待裁剪位置包括待裁剪起点位置和待裁剪终点位置;Obtaining a plurality of positions to be cropped, where the plurality of positions to be cropped include a starting point to be cropped and an end position to be cropped;
    响应裁剪指令,将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪。In response to the cropping instruction, crop the audio to be cropped between the start position to be cropped and the end position to be cropped.
  11. 根据权利要求10所述的方法,其特征在于,所述音频裁剪界面显示有音频裁剪控件,所述响应裁剪指令,将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪,包括:The method according to claim 10, wherein the audio cropping interface displays an audio cropping control, and in response to the cropping instruction, the audio to be cropped between the start position to be cropped and the end position to be cropped Carry out tailoring, including:
    当检测到作用于所述音频裁剪控件上的第五目标触控操作时,确定接收到裁剪指令;When a fifth target touch operation acting on the audio cropping control is detected, it is determined that a cropping instruction is received;
    响应所述裁剪指令,将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪。In response to the cropping instruction, crop the audio to be cropped between the start position to be cropped and the end position to be cropped.
  12. 根据权利要求10所述的方法,其特征在于,所述响应裁剪指令,将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪,包括:The method according to claim 10, wherein the responding to the cropping instruction to crop the audio to be cropped between the start position to be cropped and the end position to be cropped comprises:
    当接收到删除指令时,响应所述删除指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并删除;或When a delete instruction is received, in response to the delete instruction, cut and delete the to-be-cut audio between the start position to be cut and the end position to be cut; or
    当接收到提取指令时,响应所述提取指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并提取。When receiving the extraction instruction, in response to the extraction instruction, the to-be-cut audio between the to-be-cut starting point and the to-be-cut end position is cut and extracted.
  13. 根据权利要求12所述的方法,其特征在于,所述音频裁剪界面显示有音频删除控件,所述当接收到删除指令时,响应所述删除指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并删除,包括:The method according to claim 12, wherein the audio trimming interface displays an audio delete control, and when a delete instruction is received, the start position to be trimmed and the to-be trimmed start position are changed in response to the delete instruction. The audio to be cropped between the end positions is cropped and deleted, including:
    当检测到作用于所述音频删除控件上的第六目标触控操作时,确定接收到删除指令;When the sixth target touch operation acting on the audio delete control is detected, it is determined that a delete instruction is received;
    响应所述删除指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并删除。In response to the deletion instruction, the to-be-cut audio between the to-be-cut starting point and the to-be-cut end position is cut and deleted.
  14. 根据权利要求12或13所述的方法,其特征在于,所述音频裁剪界面显示有音频提取控件,所述当接收到提取指令时,响应所述提取指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并提取,包括:The method according to claim 12 or 13, wherein the audio cropping interface displays audio extraction controls, and when an extraction instruction is received, the starting point position to be cropped and the The audio to be cropped between the end positions to be cropped is cropped and extracted, including:
    当检测到作用于所述音频提取控件上的第七目标触控操作时,确定接收到提取指令;When the seventh target touch operation acting on the audio extraction control is detected, it is determined that an extraction instruction is received;
    响应所述提取指令将所述待裁剪起点位置和所述待裁剪终点位置之间的待裁剪音频进行裁剪并提取。In response to the extraction instruction, the audio to be cropped between the start position to be cropped and the end position to be cropped is cropped and extracted.
  15. 根据权利要求1-4任一项所述的方法,其特征在于,所述音频裁剪界面显示有播放控制控件,所述显示音频裁剪界面并播放待裁剪音频,包括:The method according to any one of claims 1 to 4, wherein the audio cropping interface displays a playback control control, and the displaying the audio cropping interface and playing the audio to be cropped comprises:
    显示所述音频裁剪界面;Displaying the audio cropping interface;
    当检测到作用于所述播放控制控件上的第一目标触控操作时,确定触发音频播放指令并播放所述待裁剪音频。When the first target touch operation acting on the playback control control is detected, it is determined that an audio playback instruction is triggered and the to-be-cut audio is played.
  16. 根据权利要求1-15任一项所述的方法,其特征在于,所述音频裁剪界面显示有裁剪位置设置控件,所述当接收到裁剪位置设置指令时,确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条;The method according to any one of claims 1-15, wherein the audio cropping interface displays a cropping position setting control, and when a cropping position setting instruction is received, it is determined that the playback progress bar is in the The current position in the waveform, using the current position as the first position and adding an audio clipping bar at the first position;
    当检测到作用于所述裁剪位置设置控件上的第二目标触控操作时,确定接收到裁剪位置设置指令;When a second target touch operation acting on the crop position setting control is detected, it is determined that a crop position setting instruction is received;
    确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条。Determine the current position of the playback progress bar in the waveform, use the current position as the first position, and add an audio cropping bar at the first position.
  17. 根据权利要求1-16任一项所述的方法,其特征在于,所述音频裁剪界面显示有播放调整控件,所述当接收到播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置,包括:The method according to any one of claims 1-16, wherein the audio cropping interface displays a playback adjustment control, and when a playback adjustment instruction is received, the playback progress bar is displayed in the waveform Adjusting to the second position pointed to by the playback adjustment instruction includes:
    当检测到作用于所述播放调整控件上的第三目标触控操作时,确定接收到播放调整指令;When a third target touch operation acting on the playback adjustment control is detected, it is determined that a playback adjustment instruction is received;
    在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置。Adjust the playback progress bar to the second position pointed by the playback adjustment instruction in the waveform.
  18. 一种音频裁剪位置的确定装置,其特征在于,所述装置包括:A device for determining an audio cutting position, characterized in that the device comprises:
    界面显示模块,用于显示音频裁剪界面并播放待裁剪音频,所述音频裁剪界面包括与所述待裁剪音频对应的波形和在所述波形中关联的播放进度条;An interface display module, configured to display an audio cropping interface and play the audio to be cropped, the audio cropping interface including a waveform corresponding to the audio to be cropped and a playback progress bar associated in the waveform;
    第一位置确定模块,用于当接收到裁剪位置设置指令时,确定所述播放进度条在所述波形中的当前位置,将所述当前位置作为第一位置并在所述第一位置添加音频裁剪条;The first position determination module is configured to determine the current position of the playback progress bar in the waveform when receiving a crop position setting instruction, use the current position as the first position and add audio to the first position Cutting bar
    第二位置调整模块,用于当接收到播放调整指令时,在所述波形中将所述播放进度条调整至所述播放调整指令指向的第二位置;The second position adjustment module is configured to adjust the playback progress bar to the second position pointed to by the playback adjustment instruction in the waveform when a playback adjustment instruction is received;
    裁剪条拖动模块,用于接收作用于所述音频裁剪条上的拖动操作,并根据所述拖动操作在所述波形中将所述音频裁剪条从所述第一位置拖动至所述第二位置;The cropping bar dragging module is configured to receive a drag operation acting on the audio cropping bar, and drag the audio cropping bar from the first position to the entire waveform in the waveform according to the drag operation The second position;
    待裁剪位置确定模块,用于将所述第二位置确定为所述待裁剪音频的待裁剪位置。The to-be-cut position determination module is configured to determine the second position as the to-be-cut position of the to-be-cut audio.
  19. 一种电子设备,其特征在于,包括存储器和处理器,所述存储器耦接到所述处理器,所述存储器存储指令,当所述指令由所述处理器执行时所述处理器执行如权利要求1-17任一项所述的方法。An electronic device, comprising a memory and a processor, the memory is coupled to the processor, the memory stores instructions, and the processor executes the instructions when the instructions are executed by the processor. The method of any one of 1-17 is required.
  20. 一种计算机可读取存储介质,其特征在于,所述计算机可读取存储介质中存储有程序代码,所述程序代码可被处理器调用执行如权利要求1-17任一项所述的方法。A computer-readable storage medium, wherein the computer-readable storage medium stores program code, and the program code can be called by a processor to execute the method according to any one of claims 1-17 .
PCT/CN2020/109842 2019-08-29 2020-08-18 Audio cutting position determination method and apparatus, electronic device, and storage medium WO2021036868A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910809621.7 2019-08-29
CN201910809621.7A CN110597438A (en) 2019-08-29 2019-08-29 Method and device for determining audio clipping position, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2021036868A1 true WO2021036868A1 (en) 2021-03-04

Family

ID=68856215

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/109842 WO2021036868A1 (en) 2019-08-29 2020-08-18 Audio cutting position determination method and apparatus, electronic device, and storage medium

Country Status (2)

Country Link
CN (1) CN110597438A (en)
WO (1) WO2021036868A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110597438A (en) * 2019-08-29 2019-12-20 Oppo广东移动通信有限公司 Method and device for determining audio clipping position, electronic equipment and storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345790A (en) * 2007-07-09 2009-01-14 上海基信通讯技术有限公司 Method for editing audio files in mobile phone
CN102176731A (en) * 2010-12-27 2011-09-07 华为终端有限公司 Method for intercepting audio file or video file and mobile phone
CN102833394A (en) * 2011-06-17 2012-12-19 沈阳晨讯希姆通科技有限公司 Mobile phone capable of generating ring of the mobile phone, and method for generating ring thereof
CN105635418A (en) * 2014-10-31 2016-06-01 东莞宇龙通信科技有限公司 Method and device for cutting bell
US20170277414A1 (en) * 2016-03-24 2017-09-28 Yamaha Corporation Data positioning method, data positioning apparatus, and computer program
CN108712671A (en) * 2018-04-26 2018-10-26 国政通科技股份有限公司 Monitor video document play-back method, device and terminal device
CN110597438A (en) * 2019-08-29 2019-12-20 Oppo广东移动通信有限公司 Method and device for determining audio clipping position, electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4401740B2 (en) * 2003-10-28 2010-01-20 キヤノン株式会社 Editing device
CN102123201A (en) * 2011-01-20 2011-07-13 深圳市五巨科技有限公司 Ringtone shearing method and device of mobile terminal
CN108847258B (en) * 2018-06-10 2021-06-04 北京酷我科技有限公司 Method for realizing interception of audio control

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101345790A (en) * 2007-07-09 2009-01-14 上海基信通讯技术有限公司 Method for editing audio files in mobile phone
CN102176731A (en) * 2010-12-27 2011-09-07 华为终端有限公司 Method for intercepting audio file or video file and mobile phone
CN102833394A (en) * 2011-06-17 2012-12-19 沈阳晨讯希姆通科技有限公司 Mobile phone capable of generating ring of the mobile phone, and method for generating ring thereof
CN105635418A (en) * 2014-10-31 2016-06-01 东莞宇龙通信科技有限公司 Method and device for cutting bell
US20170277414A1 (en) * 2016-03-24 2017-09-28 Yamaha Corporation Data positioning method, data positioning apparatus, and computer program
CN108712671A (en) * 2018-04-26 2018-10-26 国政通科技股份有限公司 Monitor video document play-back method, device and terminal device
CN110597438A (en) * 2019-08-29 2019-12-20 Oppo广东移动通信有限公司 Method and device for determining audio clipping position, electronic equipment and storage medium

Also Published As

Publication number Publication date
CN110597438A (en) 2019-12-20

Similar Documents

Publication Publication Date Title
US11750914B2 (en) Devices, methods, and graphical user interfaces for capturing and recording media in multiple modes
JP6884830B2 (en) Devices and methods that provide handwriting support in document editing
JP7097991B2 (en) Devices and methods for measuring using augmented reality
US11301126B2 (en) Icon control method and terminal
US10156974B2 (en) Information processing apparatus, display control method, and display control program
AU2012263123B2 (en) Method and apparatus for controlling a display of multimedia content using a timeline-based interface
DK179278B1 (en) Devices, methods and graphical user interfaces for haptic mixing
AU2011341876B2 (en) Method and apparatus for controlling touch screen using timeline bar, recording medium with program for the same recorded therein, and user terminal having the same
US9081491B2 (en) Controlling and editing media files with touch gestures over a media viewing area using a touch sensitive device
WO2019120013A1 (en) Video editing method and apparatus, and smart mobile terminal
WO2019217148A1 (en) Devices and methods for measuring using augmented reality
WO2021036868A1 (en) Audio cutting position determination method and apparatus, electronic device, and storage medium
EP3531250A1 (en) Devices, methods, and graphical user interfaces for haptic mixing
CN112486377B (en) Text editing method and device and electronic equipment
EP3901741B1 (en) Devices and methods for measuring using augmented reality
JP4886570B2 (en) Information processing apparatus, information processing method, and program
CN109974581B (en) Apparatus and method for measurement using augmented reality
CN113721911B (en) Control method, medium and equipment for display proportion of virtual scene

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20856903

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20856903

Country of ref document: EP

Kind code of ref document: A1